Added content
This commit is contained in:
commit
d0315792a7
0
depends.txt
Normal file
0
depends.txt
Normal file
19
init.lua
Normal file
19
init.lua
Normal file
@ -0,0 +1,19 @@
|
||||
--Spawn mod for Minetest
|
||||
--Originally written by VanessaE (I think), modified by cheapie
|
||||
--License unknown for original code, modifications are WTFPL
|
||||
|
||||
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.env: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)
|
Loading…
x
Reference in New Issue
Block a user