It would be useful a function to know if an event is registered in any resource, so it would be possible to handle the case when an event isn’t registered anywhere
nta
2
Any particular use case for that?
Yes, an example can be that some servers use anticheats that renames default event names to ““secure”” the scripts, so when triggering it to let another script handling something, it may trigger a non existing event and the script that tries to trigger the event can’t know it.
One of the most common cases can be the following one:
local sharedObjectName = "esx:getSharedObject"
if(doesEventExists(sharedObjectName)) then
TriggerEvent(sharedObjectName, function(obj)
ESX = obj
end)
else
print(sharedObjectName .. " event doesn't exists")
end
1 Like
nta
4
… so no legitimate use case, okay.
We do not condone weird client script-based ‘anticheats’ and will not add any functionality to make implementing those any easier, since the entire premise they are built on is flawed.