From 0c642d513045a69993022d4d9460b0289888b4fe Mon Sep 17 00:00:00 2001 From: vegasd Date: Sat, 1 Feb 2014 17:40:53 +0400 Subject: [PATCH] added vanish mod by Sullome --- vanish/init.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 vanish/init.lua diff --git a/vanish/init.lua b/vanish/init.lua new file mode 100644 index 0000000..d0f7914 --- /dev/null +++ b/vanish/init.lua @@ -0,0 +1,23 @@ +vanished_players = {} + +minetest.register_privilege("vanish", "Allow to use /vanish command") + +minetest.register_chatcommand("vanish", { + params = "", + description = "Make user invisible", + privs = {vanish = true}, + func = function(name, param) + local prop + vanished_players[name] = not vanished_players[name] + + if vanished_players[name] then + prop = {visual_size = {x=0, y=0}, collisionbox = {0,0,0,0,0,0}} + else + -- default player size + prop = {visual_size = {x=1, y=1}, + collisionbox = {-0.35, -1, -0.35, 0.35, 1, 0.35}} + end + + minetest.get_player_by_name(name):set_properties(prop) + end +})