Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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!

2 comments

0

If you want everything invisible you could just destroy them

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...

1 answer

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.