GanJaRuleZ Posted February 7, 2012 Share Posted February 7, 2012 Hai all , i have a problem with a script.. ERROR : [2012-02-07 12:42:06] SCRIPT ERROR: userPanel\server.lua:10: 'then' expected near '=' [2012-02-07 12:42:06] WARNING: Loading script failed: userPanel\server.lua:10: 'then' expected near '=' The script : addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish",getRootElement(), function (rank,finishtime) local account = getPlayerAccount(source) if isGuestAccount(account) then outputChatBox("You must be logged in to get the reward." , source, 255, 0, 0, true) else if rank == 1 then setAccountData( account, "Race Wins", tonumber(getAccountData(account,"Race Wins"))+1) elseif rank =< 2 then setAccountData( account, "Race Loses", tonumber(getAccountData(account,"Race Loses"))+1 ) end end end ) Link to comment
Kenix Posted February 7, 2012 Share Posted February 7, 2012 addEvent( "onPlayerFinish",true ) addEventHandler( "onPlayerFinish",root, function ( rank,finishtime ) local account = getPlayerAccount( source ) if isGuestAccount( account ) then outputChatBox( "You must be logged in to get the reward." , source, 255, 0, 0, true ) else if rank == 1 then setAccountData( account, "Race Wins", tonumber( getAccountData( account,"Race Wins" ) )+1 ) elseif rank >= 2 then setAccountData( account, "Race Loses", tonumber( getAccountData( account,"Race Loses" ) )+1 ) end end end ) 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