- init changes
This commit is contained in:
1 parent
8accf38f97
commit
d6cffd01bc
38 files changed
+325
-3377
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user