I'm trying to make an invisibility tool that makes your entire body turn invisible, then turn visible again, but for some reason it's not functioning how I would like.
local tool = script.Parent
local debounce = false
function onButton1Down(mouse)
if debounce == false then
debounce = true
local player = game.Players.LocalPlayer
for _,m in ipairs(player.Character:GetChildren()) do
if m.className == "Hat" then
m.Handle.Transparency = 1
end
if m.className == "Part" then
m.Transparency = 1
end
wait(1)
for _,mm in ipairs(m:GetChildren()) do
if mm.ClassName == "Decal" then
mm.Transparency = 1
end
wait(5)
if mm.ClassName == "Decal" then
mm.Transparency = 0
end
end
if m.className == "Hat" then
m.Handle.Transparency = 0
end
if m.className == "Part" then
m.Transparency = 0
end
end
debounce = false
end
end
function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
tool.Selected:connect(onSelected)

2 comments
Is there any output errors, or how is not acting correctly?
It put out "Selected is not a valid member of Tool".