mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-03 17:10:27 +01:00
27836d2835
- All the minetest.env calls removed It took me about 2 hours, but I did it, and it works!
16 lines
574 B
Lua
16 lines
574 B
Lua
minetest.register_on_chat_message(function(name, message, playername, player)
|
|
local cmd = "/spawn"
|
|
if message:sub(0, #cmd) == cmd then
|
|
if message == '/spawn' then
|
|
local player = minetest.get_player_by_name(name)
|
|
if minetest.setting_get_pos("static_spawnpoint") then
|
|
minetest.chat_send_player(player:get_player_name(), "Teleporting to spawn...")
|
|
player:setpos(minetest.setting_get_pos("static_spawnpoint"))
|
|
else
|
|
minetest.chat_send_player(player:get_player_name(), "ERROR: No spawn point is set on this server!")
|
|
end
|
|
return true
|
|
end
|
|
end
|
|
end)
|