forked from MTSR/invisible
Add files via upload
This commit is contained in:
parent
c5e64ab0f1
commit
b575fbd43e
8
init.lua
8
init.lua
@ -13,14 +13,13 @@ invisible.toggle=function(user,sneak)
|
||||
user:set_nametag_attributes({color = {a = 0, r = 255, g = 255, b = 255}})
|
||||
invisible[name]={}
|
||||
invisible[name].tool=sneak
|
||||
invisible[name].collisionbox=user:get_properties().collisionbox
|
||||
invisible[name].visual_size=user:get_properties().visual_size
|
||||
invisible[name].textures=user:get_properties().textures
|
||||
user:set_properties({
|
||||
visual = "mesh",
|
||||
textures={"invisible_skin.png"},
|
||||
visual_size = {x=0, y=0},
|
||||
collisionbox = {0,0,0, 0,0,0},
|
||||
pointable=false,
|
||||
})
|
||||
minetest.chat_send_player(name, "invisible on")
|
||||
else
|
||||
@ -29,7 +28,7 @@ invisible.toggle=function(user,sneak)
|
||||
visual = "mesh",
|
||||
textures=invisible[name].textures,
|
||||
visual_size = invisible[name].visual_size,
|
||||
collisionbox=invisible[name].collisionbox
|
||||
pointable=true,
|
||||
})
|
||||
invisible[name]=nil
|
||||
|
||||
@ -38,7 +37,6 @@ invisible.toggle=function(user,sneak)
|
||||
armor:update_inventory(user)
|
||||
end
|
||||
|
||||
|
||||
minetest.chat_send_player(name, "invisible off")
|
||||
end
|
||||
else
|
||||
@ -78,4 +76,4 @@ minetest.register_globalstep(function(dtime)
|
||||
invisible.toggle(player)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
Loading…
Reference in New Issue
Block a user