battle309 Posted September 26, 2012 Share Posted September 26, 2012 hey i have been working on this script for sometime now and i am wonderin why it isnt working the way i want it to it gives me 25000 every 5 mins, i want it to give 25000 to the person whos lasted 5 mins without dieing once per round. i added RaceMode.endMap but it doesnt end the map function winGame() if isTimer(timer) then destroyElement(timer) end local userdata = source timer = setTimer(function() givePlayerMoney( userdata, 25000) outputChatBox("Congratulations You Have Won, Your Reward 25000!") RaceMode.endMap() end, 300000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), winGame ) function control() resetTimer (winGame) end addEventHandler ( "onPlayerWasted", getRootElement(), control ) Link to comment
TAPL Posted September 26, 2012 Share Posted September 26, 2012 Timer is not element. use killTimer instead of destroyElement. if isTimer(timer) then destroyElement(timer) end should be if isTimer(timer) then killTimer(timer) end and please next time use lua button not Code. 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