Jump to content

[Ayuda] Evento


DuFraN

Recommended Posts

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
Link to comment

'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'.

Link to comment
  • Recently Browsing   0 members

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