Add files via upload

This commit is contained in:
AiTechEye 2021-01-05 21:59:43 +01:00 committed by GitHub
parent c5e64ab0f1
commit b575fbd43e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,14 +13,13 @@ invisible.toggle=function(user,sneak)
user:set_nametag_attributes({color = {a = 0, r = 255, g = 255, b = 255}}) user:set_nametag_attributes({color = {a = 0, r = 255, g = 255, b = 255}})
invisible[name]={} invisible[name]={}
invisible[name].tool=sneak invisible[name].tool=sneak
invisible[name].collisionbox=user:get_properties().collisionbox
invisible[name].visual_size=user:get_properties().visual_size invisible[name].visual_size=user:get_properties().visual_size
invisible[name].textures=user:get_properties().textures invisible[name].textures=user:get_properties().textures
user:set_properties({ user:set_properties({
visual = "mesh", visual = "mesh",
textures={"invisible_skin.png"}, textures={"invisible_skin.png"},
visual_size = {x=0, y=0}, visual_size = {x=0, y=0},
collisionbox = {0,0,0, 0,0,0}, pointable=false,
}) })
minetest.chat_send_player(name, "invisible on") minetest.chat_send_player(name, "invisible on")
else else
@ -29,7 +28,7 @@ invisible.toggle=function(user,sneak)
visual = "mesh", visual = "mesh",
textures=invisible[name].textures, textures=invisible[name].textures,
visual_size = invisible[name].visual_size, visual_size = invisible[name].visual_size,
collisionbox=invisible[name].collisionbox pointable=true,
}) })
invisible[name]=nil invisible[name]=nil
@ -38,7 +37,6 @@ invisible.toggle=function(user,sneak)
armor:update_inventory(user) armor:update_inventory(user)
end end
minetest.chat_send_player(name, "invisible off") minetest.chat_send_player(name, "invisible off")
end end
else else
@ -78,4 +76,4 @@ minetest.register_globalstep(function(dtime)
invisible.toggle(player) invisible.toggle(player)
end end
end end
end) end)