mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'entity.despawn' command
This commit is contained in:
parent
c9958c9718
commit
41a22938d6
8 changed files with 41 additions and 5 deletions
|
|
@ -156,3 +156,16 @@ console.add_command(
|
|||
return "spawned new player entity #"..tostring(eid)
|
||||
end
|
||||
)
|
||||
|
||||
console.add_command(
|
||||
"entity.despawn entity:sel=$entity.selected",
|
||||
"Despawn entity",
|
||||
function (args, kwargs)
|
||||
local eid = args[1]
|
||||
local entity = entities.get(eid)
|
||||
if entity ~= nil then
|
||||
entity:despawn()
|
||||
return "despawned entity #"..tostring(eid)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue