- init changes

This commit is contained in:
Mustachedom committed 2026-08-17 03:49:37 -07:00
1 parent 8accf38f97
commit d6cffd01bc
38 files changed
+325 -3377

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@ local Invoked = {}
function ServerEntity.New(id, entityType, model, coords, rotation, args)
assert(coords, "Coords are required for entity creation")
local self = args or {}
self.id = id or Ids.CreateUniqueId(Entities)
self.id = id or lib.string.random('Aa1A', 8) -- Generate a random ID if not provided
self.entityType = entityType
self.model = model
self.coords = coords
@@ -37,7 +37,7 @@ end
function ServerEntity.CreateBulk(entities)
local createdEntities = {}
for _, entityData in pairs(entities) do
local id = entityData.id or Ids.CreateUniqueId(Entities)
local id = entityData.id or lib.string.random('Aa1A', 8)
local entity = ServerEntity.New(id, entityData.entityType, entityData.model, entityData.coords, entityData.rotation, entityData)
createdEntities[id] = entity
end