Add setspawn.

This commit is contained in:
Duane 2016-06-25 15:22:50 -05:00
parent 36af3b1d92
commit af524bf009
2 changed files with 27 additions and 6 deletions

View file

@ -18,3 +18,16 @@ minetest.register_chatcommand("armor", {
end
end,
})
minetest.register_chatcommand("setspawn", {
params = "",
description = "change your spawn position",
privs = {},
func = function(name, param)
local player = minetest.get_player_by_name(name)
local pos = player:getpos()
fun_caves.db.spawn[name] = pos
minetest.chat_send_player(name, 'Your spawn position has been changed.')
end,
})