Dentos Posted August 12, 2014 Posted August 12, 2014 So i got this script for gangchat but it wont work I got no idea what to do addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "Y", "down", "chatbox", "gangChat" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "Y", "down", "chatbox", "gangChat" ) end ) function gangChat ( thePlayer, _, ... ) local isInvited = getElementData ( thePlayer, "invited" ) or false if ( isInvited ) then local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then outputChatBox ("#FF32AA [GangChat] "..getPlayerName(thePlayer)..": #FFFFFF" ..text, thePlayer, 255, 255, 255, true ) end end end addCommandHandler ( "gangChat", gangChat ) function invitePlayer ( thePlayer, _, playerName ) if not playerName then return end local playerToInvite = getPlayerFromName(playerName) if ( isElement ( playerToInvite ) ) and getElementType( argument ) == "player" then setElementData ( playerToInvite, "invited", true ) outputChatBox ( "You have been invited to the chat.", playerToInvite) else outputChatBox ( "There is no such a player!", thePlayer ) end end addCommandHandler ( "invite", invitePlayer ) Ive tried many other gang chat resources and nothing whatever I do it wont work
Dentos Posted August 12, 2014 Author Posted August 12, 2014 Sorry dont know what that is kinda new at all this
Et-win Posted August 12, 2014 Posted August 12, 2014 In-game press 't' and typ: /debugscript 3 Then start the resource again, and give all error's which are appearing, if any.
Sasu Posted August 12, 2014 Posted August 12, 2014 addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "Y", "down", "chatbox", "gangChat" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "Y", "down", "chatbox", "gangChat" ) end ) function gangChat ( thePlayer, _, ... ) local isInvited = getElementData ( thePlayer, "invited" ) or false if ( isInvited ) then local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then outputChatBox ("#FF32AA [GangChat] "..getPlayerName(thePlayer)..": #FFFFFF" ..text, thePlayer, 255, 255, 255, true ) end end end addCommandHandler ( "gangChat", gangChat ) function invitePlayer ( thePlayer, _, playerName ) if not playerName then return end local playerToInvite = getPlayerFromName(playerName) if ( isElement ( playerToInvite ) ) and getElementType( playerToInvite ) == "player" then -- At function 'getElementType' you have 'argument' as the argument but this variable doesn't exist so I supposed is 'playerToInvited' setElementData ( playerToInvite, "invited", true ) outputChatBox ( "You have been invited to the chat.", playerToInvite) else outputChatBox ( "There is no such a player!", thePlayer ) end end end addCommandHandler ( "invite", invitePlayer )
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now