]> git.lizzy.rs Git - elidragon.git/blob - warps.lua
Added warp to jumping area
[elidragon.git] / warps.lua
1 elidragon.warps = {
2     {
3         name = "shop",
4         desc = "Shop",
5         pos = {x = 0, y = 1000.5, z = 0}
6     },
7     {
8         name = "hub",
9         desc = "Hub",
10         pos = {x = 10071, y = 10003, z = 9951},
11     },
12     {
13                 name = "pvp",
14                 desc = "Pvp Area",
15                 pos = {x = 20025, y = 1003, z = 1025},
16     },
17     {
18         name = "spawn",
19         desc = "Spawn",
20         pos = {x = -21, y = 10202.5, z = -5},
21         restricted = true
22     },
23     {
24         name = "jump",
25         desc = "Jumping area",
26         pos = {x = 12286, y = 12347, z = 12556},
27     },
28
29 for _, warp in pairs(elidragon.warps) do
30     local desc = "Warp to " .. warp.desc
31     if warp.restricted then
32         desc = desc .. " [only for staff members]"
33     end
34     minetest.register_chatcommand(warp.name, {
35         description = desc,
36         privs = {teleport = warp.restricted},
37         func = function(name)
38             local player = minetest.get_player_by_name(name)
39             if player then
40                 player:set_pos(warp.pos)
41             end
42         end
43     })
44 end