Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make the t-shirt of a character's transparency 1?

Asked by 8 years ago

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!

0
If you want everything invisible you could just destroy them NinjoOnline 1146 — 8y
0
I need to get them back so I can't destroy them and plus I don't know what I would need to destroy to destroy a Character's T-Shirt... KingLoneCat 2642 — 8y

1 answer

Log in to vote
3
Answered by 8 years ago

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)

Ad

Answer this question