Server and client entity update

syncing non networked entities to all players in range
allow for firing functions when entering or exiting the range of the entity
This commit is contained in:
gononono64 committed 2025-04-28 22:51:54 -05:00
1 parent 7cc4821345
commit c23df31199
5 files changed
+417 -96

No files matched your search

+4 -2
View File
@@ -58,13 +58,15 @@ end
-- @param entityId string|number The ID of the entity.
-- @param actionName string The name of the action to trigger (must match a function in ClientEntityActions).
-- @param ... any Additional arguments for the action function.
function ServerEntity.TriggerAction(entityId, actionName, ...)
function ServerEntity.TriggerAction(entityId, actionName, endPosition, ...)
print("Triggering action: ", entityId, actionName, ...)
local entity = Entities[entityId]
if not entity then
print(string.format("[ServerEntity] Attempted to trigger action '%s' on non-existent entity %s", actionName, entityId))
return
end
TriggerClientEvent("community_bridge:client:TriggerEntityAction", -1, entityId, actionName, ...)
print(string.format("[ServerEntity] Triggering action '%s' for entity %s", actionName, entityId))
TriggerClientEvent("community_bridge:client:TriggerEntityAction", -1, entityId, actionName, endPosition, ...)
end
function ServerEntity.GetAll()