New files

master
Tmanyo 2016-12-13 19:27:02 -05:00
commit 3cfb1bb868
2 changed files with 26 additions and 0 deletions

26
init.lua Normal file
View File

@ -0,0 +1,26 @@
minetest.register_node("leave_spawn:button", {
description = "Leave Spawn Button",
groups = {not_in_creative_inventory=1, cracky=3, crumbly=3},
tiles = {"button.png"},
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
if minetest.check_player_privs(player:get_player_name(), {interact=true}) == true then
local pos = player:getpos()
pos.x = pos.x + 10
player:setpos(pos)
else
minetest.kick_player(player:get_player_name(), "You don't have interact yet.")
end
end
})
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
if node.name == "leave_spawn:button" then
if minetest.check_player_privs(puncher:get_player_name(), {interact=true}) == true then
local pos = puncher:getpos()
pos.x = pos.x + 10
puncher:setpos(pos)
else
minetest.kick_player(puncher:get_player_name(), "You don't have interact yet.")
end
end
end)

BIN
textures/button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B