mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
standard command moved to stdcmd.lua
This commit is contained in:
parent
e273829ef5
commit
abf8d4f796
3 changed files with 34 additions and 34 deletions
33
res/scripts/stdcmd.lua
Normal file
33
res/scripts/stdcmd.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
console.add_command(
|
||||
"tp obj:sel=$obj.id x:num~pos.x y:num~pos.y z:num~pos.z",
|
||||
function (args, kwargs)
|
||||
player.set_pos(unpack(args))
|
||||
end
|
||||
)
|
||||
console.add_command(
|
||||
"echo value:str",
|
||||
function (args, kwargs)
|
||||
return args[1]
|
||||
end
|
||||
)
|
||||
console.add_command(
|
||||
"time.set value:num",
|
||||
function (args, kwargs)
|
||||
return world.set_day_time(args[1])
|
||||
end
|
||||
)
|
||||
console.add_command(
|
||||
"fill id:str x:num~pos.x y:num~pos.y z:num~pos.z w:int h:int d:int",
|
||||
function (args, kwargs)
|
||||
local name, x, y, z, w, h, d = unpack(args)
|
||||
local id = block.index(name)
|
||||
for ly=0,h-1 do
|
||||
for lz=0,d-1 do
|
||||
for lx=0,w-1 do
|
||||
block.set(x+lx, y+ly, z+lz, id)
|
||||
end
|
||||
end
|
||||
end
|
||||
return tostring(w*h*d).." blocks set"
|
||||
end
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue