Benevolence Posted September 22, 2011 Share Posted September 22, 2011 So for learning purposes, I'm trying to make this code which will respawn you in the xyz cords given after 2 seconds then when you respawn it gives you a little message. The thing is, after I commit suicide it spawns me instantly. I want it to make me wait 2 seconds. It's not working, what am I doing wrong? function onPlayerWasted() local x = 1742.47546 local y = -1861.00513 local z = 13.57804 spawnPlayer(source, x, y, z) setTimer(spawnPlayer, 5000, 1) --setTimer(spawnPlayer, x, y, z, source, 0, 0, 3 ) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("You've been respawned as a result of your death.", source) end addEventHandler("onPlayerWasted", getRootElement(), onPlayerWasted) Link to comment
Castillo Posted September 22, 2011 Share Posted September 22, 2011 function onPlayerWasted() local x = 1742.47546 local y = -1861.00513 local z = 13.57804 setTimer(spawnPlayer, 5000, 1, source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("You've been respawned as a result of your death.", source) end addEventHandler("onPlayerWasted", getRootElement(), onPlayerWasted) 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