So, I am trying to make a script in which when you press "q" then the Character
of the Player
becomes invisible however some players have T-Shirts and I want the Character
to be completely invisible Also I don't want to remove anything from the Character
because I will need to give it back to the Character
after a certain amount of time.... I was wondering if someone can help me out and give me the best way to do this? Remember I want the Transparency of everything visible inside the Character
to go to 1 so I can make it go back to 0 since I want to make it come back.... This is what I got done so far..... I am trying to make the whole player invisible first....
player = game.Players.LocalPlayer mouse = player:GetMouse() mouse.KeyDown:connect(function(key) if key == "q" then for i,v in pairs(player.Character:GetChildren()) do if v.ClassName == "Hat" then v.Handle.Transparency = 1 elseif v:IsA("BasePart") then v.Transparency = 1 if v.Name == "Torso" then for _, s in pairs(v) do if s:IsA("Decal") then s.Transparency = 1 end end end end end end end)
Thank you for reading!
I've fixed a Code for you:
player = game.Players.LocalPlayer mouse = player:GetMouse() mouse.KeyDown:connect(function(key) if key == "q" then for i,v in pairs(player.Character:GetChildren()) do if v.ClassName == "Hat" then v.Handle.Transparency = 1 elseif v:IsA("BasePart") then v.Transparency = 1 for _, s in pairs(v:GetChildren()) do if s:IsA("Decal") then s.Transparency = 1 end end end end end end)