Jump to content

hey guys problems here


battle309

Recommended Posts

Posted

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 ) 

Posted

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.

Lj1UB.png

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...