Jump to content

Race Stats


#Paper

Recommended Posts

Posted

If i use this code:

function onWasted() 
if state == "Running" or state == "PostFinish" then 
  
end 
end 
addEventHandler("onPlayerWasted", getRootElement(), onWasted) 

the function wont work, if i use this one:

function onWasted() 
end 
addEventHandler("onPlayerWasted", getRootElement(), onWasted) 

 

The function works.

 

The "state" variable is defined here:

 

local state = "" 
  
function raceStat(newStateName) 
state = newStateName 
end 
addEvent("onRaceStateChanging", true) 
addEventHandler( "onRaceStateChanging", getRootElement(), raceStat) 

Posted
If i use this code:

The "state" variable is defined here:

and where is "here"? same file? same resource, but other file?

Posted

this might look dumb but i've had many problems with IF's when I wasn't using paranthesis so you might wanna try the following:

if (state == "Running") or (state == "PostFinish") then

Posted

and what makes you so sure the error is in the lines you've posted, and not in the deleted ones?

Posted

the error is in the code that i've posted, cuz if i use the first one code i've posted the fuction wont work, instead if i use the second one it works.. so...

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...