add castle / rocket command
This commit is contained in:
parent
094dea945e
commit
e64b1211cc
29
commands.lua
29
commands.lua
@ -1,25 +1,38 @@
|
||||
command = {}
|
||||
minetest.register_chatcommand("spawn", {
|
||||
params = "<player>",
|
||||
privs = {interact=true},
|
||||
description = "Teleports you to the Spawnpoint",
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
local spawnPoint = minetest.setting_get("static_spawnpoint")
|
||||
minetest.get_player_by_name(name):setpos(minetest.string_to_pos(spawnPoint))
|
||||
minetest.chat_send_player(name, "Teleporting to Spawnpoint...")
|
||||
minetest.chat_send_player(name, "Alright, enjoy the Spawnpoint.")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("spawn2", {
|
||||
local rocket = {"spawn2","rocket"}
|
||||
for i = 1,2 do
|
||||
local rocket = rocket[i]
|
||||
minetest.register_chatcommand(rocket, {
|
||||
params = "<player>",
|
||||
description = "Teleports you to the old Spawnpoint rocket",
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
local spawnPoint = minetest.setting_get("old_spawnpoint")
|
||||
minetest.get_player_by_name(name):setpos(minetest.string_to_pos(spawnPoint))
|
||||
minetest.chat_send_player(name, "Okey, have fun at the old Spawnrocket.")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("castle", {
|
||||
params = "<player>",
|
||||
privs = {interact=true},
|
||||
description = "Teleports you to the old Spawnpoint",
|
||||
description = "Teleports you to the castle",
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
local spawnPoint = minetest.setting_get("old_spawnpoint")
|
||||
minetest.get_player_by_name(name):setpos(minetest.string_to_pos(spawnPoint))
|
||||
minetest.chat_send_player(name, "Teleporting to old Spawnpoint...")
|
||||
local castle = minetest.setting_get("castle")
|
||||
minetest.get_player_by_name(name):setpos(minetest.string_to_pos(castle))
|
||||
minetest.chat_send_player(name, "Enjoy the Illuna castle.")
|
||||
end,
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user