18 lines
561 B
Lua
18 lines
561 B
Lua
-- GNU GPLv3+
|
|
-- jadedctrl
|
|
|
|
minetest.register_chatcommand("spawn", {
|
|
description = "Teleport to spawn",
|
|
func = function(player_name)
|
|
local player = minetest.get_player_by_name(player_name)
|
|
|
|
if minetest.setting_get("static_spawnpoint")
|
|
then
|
|
player:setpos(minetest.string_to_pos(minetest.setting_get("static_spawnpoint")))
|
|
else
|
|
minetest.chat_send_player(player_name, "No static spawn is set-- the gods can't help you now.")
|
|
minetest.chat_send_player(player_name, "It's time to take action: perhaps /killme, if you're in a bind?")
|
|
end
|
|
end
|
|
})
|