Waffeleisen Posted October 11, 2013 Share Posted October 11, 2013 Hello Guys, i have try to make an respawn script and collected commands and so on from the wiki. The problem is, thers no Error and idk whats wrong with it. Im not so very experience about scripting. source = thePlayer function spawnPlayer() local x, y, z = getElementPosition(source) spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) end function () setTimer ( spawnPlayer, 1000, 1, source) end addEventHandler("onPlayerWasted", getRootElement(), spawnPlayer ) I hope someone can help me. Link to comment
isa_Khamdan Posted October 11, 2013 Share Posted October 11, 2013 (edited) thePlayer is not defined anywhere in your code. Try this function spawn(thePlayer) if not isElement(thePlayer) then return end local x, y, z = getElementPosition(thePlayer) until spawnPlayer(thePlayer, x, y, z) fadeCamera(thePlayer, true) setCameraTarget(thePlayer, thePlayer) end addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1000, 1, source) end ) Edited October 11, 2013 by Guest Link to comment
Waffeleisen Posted October 11, 2013 Author Share Posted October 11, 2013 Wow, its working perfectly and i understand it now So the Lanparty can start tomorow. You helped me so much, thanks! #closereq 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