Jump to content

Making a restart function


devil666

Recommended Posts

Im trying to make a restart function for a race where when someone hits the finish line it will count down from 20 then restart the race resource but idk what is wrong i have the count down working but i can get the restart resource to work someone please help me! here is what i have so far!

function RestartRace (Restart)

if (Restart > 0) then

outputChatBox(tostring(Restart), getRootElement(), 255, 255, 255)

setTimer(RestartRace, 1000, 1, Restart-1)

else

outputChatBox("Restarting Race Now!!!!", getRootElement(), 255, 255, 255)

triggerServerEvent ( "aResource", getLocalPlayer(), "allgates", "restart" )

end

end

Link to comment

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