battle309 Posted September 25, 2012 Posted September 25, 2012 bad arguements line 6 give money local count = 0 function winGame() setTimer ( winGame, 1000, 0 ) if count== 300 then givePlayerMoney ( player, 25000 ) outputChatBox("You have won!") else count = count + 1 end end addEventHandler ( "onPlayerSpawn", getRootElement(), winGame )
battle309 Posted September 25, 2012 Author Posted September 25, 2012 do you guys know why this is causing error
Renkon Posted September 25, 2012 Posted September 25, 2012 Well, is this serverside? since count will go +1 for everybody joining and also every time there is a timer. And then it would be FUCKED UP. My recommendation? function winGame() setTimer(function() givePlayerMoney( source, 25000) outputChatBox("You have won!") end, 300000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), winGame )
battle309 Posted September 25, 2012 Author Posted September 25, 2012 i used that script and i get bad argument give cash still
Renkon Posted September 25, 2012 Posted September 25, 2012 function winGame() if isTimer(timer) then destroyElement(timer) end local userdata = source timer = setTimer(function() givePlayerMoney( userdata, 25000) outputChatBox("You have won!") end, 300000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), winGame )
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