Jump to content

[Ayuda] Evento


DuFraN

Recommended Posts

Posted

Hola, tengo una duda sobre este evento, si uso "root2 el evento detectara cualquier player que haya muerto, como hago para que solo me detecte ami?

addEventHandler("onPlayerWasted",root,Cuando_Muera) 

Posted (edited)

Lo hice pero hay algo que no funciona, segun lo que te entendi :3

function ejemplo() 
if source == getPlayerName(source) then 
 outputChatBox("Funciona"   ,source,255,255,255,true) 
else 
outputChatBox("No funciona"   ,source,255,255,255,true) 
end 
addEventHandler("onPlayerWasted",root,ejemplo) 
  

hice ese mismo ejemplo, no me da error en el debug ni nada pero, me aparece "no funciona"

Edited by Guest
Posted

'source' es un jugador, mientras que 'getPlayerName(source)' es un string.

Prueba así:

function ejemplo() 
if 'TU NOMBRE' == getPlayerName(source) then 
 outputChatBox("Funciona"   ,source,255,255,255,true) 
else 
outputChatBox("No funciona"   ,source,255,255,255,true) 
end 

*Quizá te entendí mal y lo que quieres es que un código solo se ejecute en el jugador que murió sin afectar a los demás, en ese caso deberías utilizar 'onClientPlayerWasted' y comparar si 'source' en ese evento es igual a 'localPlayer'.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...