Page 1
Client-Side Exports
Spawn('Object', hash, coords, isOrphan, keepLoad)
hash
(number): The model hash of the object.coords
(table): The coordinates where the object will spawn (e.g.,{x = 0, y = 0, z = 0, w = 0}
).isOrphan
(boolean): Whether the object should be marked as an "orphan" for server tracking.keepLoad
(boolean): Whether to keep the model loaded after spawning.
Spawn('RmObject', object)
object
(Entity): The reference to the object to be removed.
Spawn('RmObjectByNetId', netId)
netId
(number): The network ID of the object to be removed.
Spawn('Local.Object', hash, coords)
hash
(number): The model hash of the object.coords
(table): The coordinates where the object will spawn.
Server-Side Exports
Spawn('Object', hash, coords, cb)
hash
(number): The model hash of the object.coords
(table): The coordinates where the object will spawn.
Spawn('RmObject', object)
object
(Entity): The reference to the object to be removed.
Spawn('RmObjectByNetId', netId)
Examples
Client-Side Example
local coords = {x = 100.0, y = 200.0, z = 300.0}
local hash = `prop_boxpile_07d`
exports['your_resource_name']:Spawn('Object', hash, coords, true)
Server-Side Example
local coords = {x = 100.0, y = 200.0, z = 300.0}
local hash = `prop_boxpile_07d`
exports['your_resource_name']:Spawn('Object', hash, coords, function(obj, netId)
print("Created object with Net ID:", netId)
end)
Last updated