So I have a lua file on the server setup and I’m trying to use gameEventTriggered but it isn’t firing at all. Anyone got any ideas?
What I’m using in my code:
AddEventHandler('gameEventTriggered', function(eventName, args)
So I have a lua file on the server setup and I’m trying to use gameEventTriggered but it isn’t firing at all. Anyone got any ideas?
What I’m using in my code:
AddEventHandler('gameEventTriggered', function(eventName, args)
Double check you are using this on the client and not the server.
Not all game events are created equal, but do some troubleshooting first:
print("test")
at the top of the file. This should print test
in your client console (F8).gameEventTriggered
is mostly used for “networked” events. The true low-level events are triggered using their individual event handler. The topic above should show that.I was using it on the server. What would be a good alternative for something like the NetworkEntityDamaged event? I’m working on a medical system and I want to know when a client player has been damaged. I’m a little hesitant to run that on the client given the fact that they could stop the reporting of damage from the client end.
Off the top of my head? Assuming it doesn’t need to be updated instantly, you could run a loop every couple of seconds and iterate over all player’s total health, if there’s any decrease you could then send an event to said client, get the medical details you wanted and send it back to the server using an internal callback, which is harder for clients to spoof.