Chrimam Posted February 20, 2013 Share Posted February 20, 2013 It keeps saying bad argument @ spawnPlayer I tried function getCoords(source) but it says bad argument @getElementPosition expected element at argument 1, got number '0' (Yes. I also tried spawnCoords(source, wastedX, wastedY, wastedZ, wastedSkin) function getCoords() wastedX, wastedY, wastedZ = getElementPosition(source) wastedSkin = getElementModel(source) setTimer(spawnCoords, 1000, 1) end addEventHandler ( "onPlayerWasted", getRootElement(), getCoords ) function spawnCoords(wastedX, wastedY, wastedZ, wastedSkin) spawnPlayer(source, wastedX, wastedY, wastedZ, 0, wastedSkin) end Link to comment
PaiN^ Posted February 20, 2013 Share Posted February 20, 2013 addEventHandler ( "onPlayerWasted", root, function () wastedX, wastedY, wastedZ = getElementPosition( source ) wastedSkin = getElementModel(source) spawnPlayer(source, wastedX, wastedY, wastedZ, 0, wastedSkin) end ) Link to comment
Chrimam Posted February 20, 2013 Author Share Posted February 20, 2013 That's why i put a timer there. It spawns me immediately after i die. I can't understand if died. I want to be spawned after 1 second or so. Link to comment
Vision Posted February 20, 2013 Share Posted February 20, 2013 addEventHandler ( "onPlayerWasted", root, function ( ) wastedX, wastedY, wastedZ = getElementPosition ( source ) wastedSkin = getElementModel ( source ) setTimer ( spawnPlayer, 1000, 1, source, wastedX, wastedY, wastedZ, 0, wastedSkin ) end ) Link to comment
TAPL Posted February 20, 2013 Share Posted February 20, 2013 function getCoords() local wastedX, wastedY, wastedZ = getElementPosition(source) local wastedSkin = getElementModel(source) setTimer(spawnCoords, 1000, 1, source, wastedX, wastedY, wastedZ, wastedSkin) end addEventHandler("onPlayerWasted", root, getCoords) function spawnCoords(source, wastedX, wastedY, wastedZ, wastedSkin) spawnPlayer(source, wastedX, wastedY, wastedZ, 0, wastedSkin) setCameraTarget(source) end Link to comment
Chrimam Posted February 20, 2013 Author Share Posted February 20, 2013 Thanks Castro it worked Edit: TAPL your script's working too. 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