Alexs Posted May 6, 2012 Posted May 6, 2012 Hola a Todos, Hice este script: Server: function pocavida ( attacker, weapon, bodypart, loss ) local salud = getElementHealth ( source ) if (salud <= 15 ) then triggerClientEvent ( "crearimagen", source ) end end addEventHandler ( "onPlayerDamage", getRootElement (),pocavida ) Client: function imagen ( ) local imgd = guiCreateStaticImage(0,0,1,1,"dano.png",true) end addEvent( "crearimagen", true ) addEventHandler( "crearimagen", getRootElement (), imagen ) Y funciona Bien, pero cuando respawneo la imagen sigue ahi intente agregar esto al Client: function alaparecer ( ) destroyElement ( imgd ) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), alaparecer ) pero el Debugscript dice "Bad Argument" que puedo hacer o usar?
Alexs Posted May 6, 2012 Author Posted May 6, 2012 emm... el script si funciona, pero cuando respawneo quiero sacar la imagen...
Alexs Posted May 6, 2012 Author Posted May 6, 2012 isElement dice si el argumento es un elemento, no si este esta activo...
Edikosh998 Posted May 6, 2012 Posted May 6, 2012 Aaaa ya me di cuenta... Le pusiste local a la variable imgd
Alexs Posted May 6, 2012 Author Posted May 6, 2012 Ahora funciono, pero por lo que veo "onClientPlayerDamage" no funciona con los zombies, buscare otro evento..
Recommended Posts