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 change the transparency of the character?

The script below is a clothing server script. I am trying to make a part inside of the arms of character visible but it does not work. How can I fix this?



game.ReplicatedStorage.Events.ShirtEvent1.OnServerEvent:Connect(function(plr)
	
	local char = plr.Character
	local Button = game.StarterGui.Clothing.Shirts.BlackShirt
	local q = BrickColor.new("Really black")
	
	char["UpperTorso"].BrickColor = q
	char["LeftUpperArm"].LeftUpperSleeve.BrickColor = q
	char["LeftLowerArm"].LeftLowerSleeve.BrickColor = q
	char["RightLowerArm"].RightLowerSleeve.BrickColor = q
	char["RightUpperArm"].RightUpperSleeve.BrickColor = q
	-----------------------
	char["LeftUpperArm"].LeftUpperSleeve.Opacity = 1
	char["LeftLowerArm"].LeftLowerSleeve.Opacity = 1
	char["RightLowerArm"].RightLowerSleeve.Opacity = 1
	char["RightUpperArm"].RightUpperSleeve.Opacity = 1
	char.LowerTorso.BrickColor = q
	
end)

3 comments

0

Transparency, not Opacity

0

There is nothing called "Opacity" in any property. It's called Transparency. You can set it from 0, to 1. 1 means invisible, 0 means visible. 0.5 means half opacity.

0

I tried opacity because i thought i saw someone use opacity, I tried using transparency and it still did not work

2 answers

✓ Accepted answer

Your issue is that you are attempting to change a property called "Opacity", which does not exist. The property that you're looking for is called Transparency, which is scaled from 0 to 1 (0 being fully visible, 1 being completely invisible.

Assuming the rest of your code is fine, then...

game.ReplicatedStorage.Events.ShirtEvent1.OnServerEvent:Connect(function(plr)

    local char = plr.Character
    local Button = game.StarterGui.Clothing.Shirts.BlackShirt
    local q = BrickColor.new("Really black")

    char["UpperTorso"].BrickColor = q
    char["LeftUpperArm"].LeftUpperSleeve.BrickColor = q
    char["LeftLowerArm"].LeftLowerSleeve.BrickColor = q
    char["RightLowerArm"].RightLowerSleeve.BrickColor = q
    char["RightUpperArm"].RightUpperSleeve.BrickColor = q
    -----------------------
    char["LeftUpperArm"].LeftUpperSleeve.Transparency = 1
    char["LeftLowerArm"].LeftLowerSleeve.Transparency = 1
    char["RightLowerArm"].RightLowerSleeve.Transparency = 1
    char["RightUpperArm"].RightUpperSleeve.Transparency = 1
    char.LowerTorso.BrickColor = q

end)

My mistake was i thought the character I had in workspace had sleeve parts welded to the arms.

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