FlyingSpoon Posted April 24, 2015 Posted April 24, 2015 - - CLIENT-SIDE addEventHandler("onClientPlayerWasted", getRootElement(), function () if source == localPlayer then spawnSystem() setElementHealth ( localPlayer, 100 ) triggerServerEvent ( "on.death", localPlayer ) end end) SERVER-SIDE function onPlayerDeath() takeAllWeapons ( source ) end addEvent("on.death", true) addEventHandler("on.death", getRootElement(), onPlayerDeath)) When I spawn as a new character, my health is still 0 and I am basically dead, why? GitHub: https://github.com/flyingspoon YouTube: https://www.youtube.com/channel/UClsnd4SEid3gob33DSk1-GQ
FlyingSpoon Posted April 24, 2015 Author Posted April 24, 2015 Nothing still happens. GitHub: https://github.com/flyingspoon YouTube: https://www.youtube.com/channel/UClsnd4SEid3gob33DSk1-GQ
Walid Posted April 24, 2015 Posted April 24, 2015 Nothing still happens. You need to use i think you are trying to use setElementPosition() spawnPlayer ( ) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
FlyingSpoon Posted April 24, 2015 Author Posted April 24, 2015 Well I changed it a little, CLIENT-SIDE function spawnSystem() --- addEvent("openGUI", true) addEventHandler("openGUI", getRootElement(), spawnSystem) SERVER-SIDE function onDeath() triggerClientEvent(source, "openGUI", source) takeAllWeapons ( source ) end addEventHandler("onPlayerWasted", getRootElement(), onDeath) Doesn't open GUI when I died? GitHub: https://github.com/flyingspoon YouTube: https://www.youtube.com/channel/UClsnd4SEid3gob33DSk1-GQ
WhoAmI Posted April 24, 2015 Posted April 24, 2015 function onDeath() triggerClientEvent(source, "openGUI", source) takeAllWeapons ( source ) setElementHealth ( source, 100 ) end addEventHandler("onPlayerWasted", getRootElement(), onDeath)
FlyingSpoon Posted April 24, 2015 Author Posted April 24, 2015 Still doesn't open GUI. GitHub: https://github.com/flyingspoon YouTube: https://www.youtube.com/channel/UClsnd4SEid3gob33DSk1-GQ
Walid Posted April 24, 2015 Posted April 24, 2015 Still doesn't open GUI. Post your code here Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
FlyingSpoon Posted April 24, 2015 Author Posted April 24, 2015 CLIENT-SIDE function spawnSystem() --- addEvent("openGUI", true) addEventHandler("openGUI", getRootElement(), spawnSystem) SERVER-SIDE function onDeath() triggerClientEvent(source, "openGUI", source) takeAllWeapons ( source ) end addEventHandler("onPlayerWasted", getRootElement(), onDeath) GitHub: https://github.com/flyingspoon YouTube: https://www.youtube.com/channel/UClsnd4SEid3gob33DSk1-GQ
Dimos7 Posted April 24, 2015 Posted April 24, 2015 CLIENT-SIDE function spawnSystem() --- addEvent("openGUI", true) addEventHandler("openGUI", getRootElement(), spawnSystem) SERVER-SIDE function onDeath() triggerClientEvent(source, "openGUI", getRootElement()) takeAllWeapons (source) end addEventHandler("onPlayerWasted", getRootElement(), onDeath)
Enargy, Posted April 24, 2015 Posted April 24, 2015 as Walid told you, do you find this? --SERVER function onDeath() local my_position = {getElementPosition( source )}; local playerSpawn = setTimer(spawnPlayer, 2000, 1, source, unpack(my_position) ); if playerSpawn then triggerClientEvent(source, "openGUI", source); takeAllWeapons ( source ); end end addEventHandler("onPlayerWasted", getRootElement(), onDeath) -- CLIENT function spawnSystem() outputChatBox("I am respawning") end addEvent("openGUI", true) addEventHandler("openGUI", getRootElement(), spawnSystem) otherwise I tried your code with outputs and it works perfectly. i don't know but it might be your spawnSystem function - Inactivo.
Walid Posted April 25, 2015 Posted April 25, 2015 Guys i already helped him via PM . @raysmta next time try to write resolved ; fixed something like that. Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
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