kevin11 Posted May 4, 2010 Posted May 4, 2010 (edited) i tried it and it doesnt give error but when i do /roll nothing happens addCommandHandler("roll", function(player,comd) randomroll = math.random(1, 3000) lossorwin = math.random(1, 3) if lossorwin == 1 then givePlayerMoney(player, 3500) outputChatBox ( ' .. getPlayerName ( thePlayer ) .. ' roll and wins ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) elseif lossorwin == 2 then takePlayerMoney(player, 3252) outputChatBox ( ' .. getPlayerName ( thePlayer ) .. ' roll and losses ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) elseif lossorwin == 3 then setPlayerMuted(player, true) setTimer(setPlayerMuted, 30000, 1, player, false) end end ) Edited May 4, 2010 by Guest
robhol Posted May 4, 2010 Posted May 4, 2010 Look at the code again. You're messing up the strings in outputChatBox. And use debugscript.
eAi Posted May 4, 2010 Posted May 4, 2010 The fact that even the syntax highlighting in your code above is broken is a good sign you've done something wrong.
dzek (varez) Posted May 4, 2010 Posted May 4, 2010 look at the lines 8-10 .. its all red.. something MUST be wrong then happy finding
karlis Posted May 4, 2010 Posted May 4, 2010 addCommandHandler("roll", function(player,comd) randomroll = math.random(1, 3000) lossorwin = math.random(1, 3) if lossorwin == 1 then givePlayerMoney(player, 3500) outputChatBox ( getPlayerName ( thePlayer ) .. ' roll and wins ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) elseif lossorwin == 2 then takePlayerMoney(player, 3252) outputChatBox ( getPlayerName ( thePlayer ) .. ' roll and losses ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) elseif lossorwin == 3 then setPlayerMuted(player, true) setTimer(setPlayerMuted, 30000, 1, player, false) end end )
Recommended Posts