Narutimmy Posted April 12, 2014 Posted April 12, 2014 Hola bueno ise este script la idea es al morir te transporta a la misma posision pero 500m en el aire con un paracaidas... pero no funciona local R, T, Y = getElementPosition(thePlayer) function Restart ( thePlayer ) setElementData(thePlayer,"AAutoS",0) setElementData(thePlayer,"Iitemss",0) setTimer ( function (thePlayer) setElementPosition ( thePlayer, R, T, Y + 500 ) giveWeapon ( thePlayer, 46, 1 ) end , 5000, 1 ) end addEventHandler ( "onPlayerWasted", getRootElement(), Restart )
Castillo Posted April 12, 2014 Posted April 12, 2014 1º 'thePlayer' no esta definido, usa 'source'. 2º getElementPosition esta fuera de la funcion "Restart".
Narutimmy Posted April 12, 2014 Author Posted April 12, 2014 1º 'thePlayer' no esta definido, usa 'source'.2º getElementPosition esta fuera de la funcion "Restart". si lo intente con source pero no me funciono tambien el get lo tenia dentro de la funcion y nada me daba error en el argumento 1, o error al obtener la "Y" EDIT: Porque no funciona el " " ?¿
Narutimmy Posted April 12, 2014 Author Posted April 12, 2014 Ahora es[ code=lua ] [ /code ] mm lo cambiaron, gracias
Tomas Posted April 13, 2014 Posted April 13, 2014 Con el setTimer no me dejó... addEventHandler( "onPlayerWasted", getRootElement( ), function () setElementData(source,"AAutoS",0) setElementData(source,"Iitemss",0) local a,b,c = getElementPosition(source) spawnPlayer(source, a,b,c +500) giveWeapon ( source, 46, 1 ) end )
Narutimmy Posted April 14, 2014 Author Posted April 14, 2014 Con el setTimer no me dejó... addEventHandler( "onPlayerWasted", getRootElement( ), function () setElementData(source,"AAutoS",0) setElementData(source,"Iitemss",0) local a,b,c = getElementPosition(source) spawnPlayer(source, a,b,c +500) giveWeapon ( source, 46, 1 ) end ) Listo Gracias.
Recommended Posts