Imposter Posted July 25, 2012 Share Posted July 25, 2012 serverside function giveClue ( hitElement, matchingDimension) destroyElement( clueMarker ) local cash = math.random( 10000, 15000 ) givePlayerMoney ( hitElement, cash ) outputChatBox ( hitElement .. " has found the clue, he got $" .. cash .. "! The new clue will be spawned in 10 minutes!" ) setTimer ( putClue, 600000, 1 ) end i need the player name but get this error [2012-07-25 10:08:16] ERROR: [roleplay]\clue\server.lua:6: attempt to concatenate local 'hitElement ' (a userdata value) Link to comment
TAPL Posted July 25, 2012 Share Posted July 25, 2012 function giveClue ( hitElement, matchingDimension) destroyElement( clueMarker ) local cash = math.random( 10000, 15000 ) givePlayerMoney ( hitElement, cash ) outputChatBox(getPlayerName(hitElement).." has found the clue, he got $" .. cash .. "! The new clue will be spawned in 10 minutes!") setTimer ( putClue, 600000, 1 ) end Link to comment
Imposter Posted July 25, 2012 Author Share Posted July 25, 2012 One more thing, how do i make this so that the args after command are counted as one string. function addPickup ( thePlayer, command, desc ) outputChatBox ( desc ) end addCommandHandler ("makeclue", addPickup) Link to comment
TAPL Posted July 25, 2012 Share Posted July 25, 2012 function addPickup(thePlayer, command,...) local text = table.concat({...}, " ") outputChatBox(text) end addCommandHandler("makeclue", addPickup) Link to comment
Castillo Posted July 25, 2012 Share Posted July 25, 2012 function addPickup ( thePlayer, command, ... ) outputChatBox ( table.concat ( { ... }, " " ) ) end addCommandHandler ( "makeclue", addPickup ) Link to comment
Imposter Posted July 25, 2012 Author Share Posted July 25, 2012 function addPickup ( thePlayer, command, ... ) outputChatBox ( table.concat ( { ... }, " " ) ) end addCommandHandler ( "makeclue", addPickup ) thanks Link to comment
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