Rebound entity stuff

added function to get a local offset world position from a point
updated entities to automatically process next queued action without needing to call processnextaction
Added client freeze, circle, and bobupanddown for client/rebound entity manipulation
This commit is contained in:
gononono64 committed 2025-05-04 11:11:29 -05:00
1 parent 3cb9829f4f
commit 4d8b2ff203
5 files changed
+174 -11

No files matched your search

+24
View File
@@ -156,6 +156,10 @@ function ClientEntity.GetAll()
return Entities
end
function ClientEntity.RegisterAction(name, func)
ClientEntityActions.RegisterAction(name, func)
end
-- Network Event Handlers
RegisterNetEvent("community_bridge:client:CreateEntity", function(entityData)
ClientEntity.Register(entityData)
@@ -190,6 +194,26 @@ RegisterNetEvent("community_bridge:client:TriggerEntityAction", function(entityI
end
end)
RegisterNetEvent("community_bridge:client:TriggerEntityActions", function(entityId, actions, endPosition)
local entityData = Entities[entityId]
if entityData then
for _, actionData in pairs(actions) do
local actionName = actionData.name
local actionParams = actionData.params
if actionName == "Stop" then
ClientEntityActions.StopAction(entityId)
elseif actionName == "Skip" then
ClientEntityActions.SkipAction(entityId)
else
local currentAction = ClientEntityActions.ActionQueue[entityId] and ClientEntityActions.ActionQueue[entityId][1]
ClientEntityActions.QueueAction(entityData, actionName, table.unpack(actionParams))
end
end
else
print(string.format("[ClientEntity] Received actions for non-existent entity %s.", entityId))
end
end)
-- Resource Stop Cleanup
AddEventHandler('onResourceStop', function(resourceName)
if resourceName == GetCurrentResourceName() then