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 transparency?

So I am making my script and I need transparency. So it works fine with head and torso but how do I make it work on Arms or Legs? I tryed something like LeftArm(Hand)

works fine with the main parts:

game.Workspace.[Name].[Part].Transparency = 0.5

Btw I don't know what tag should I add here

1 comment

0

Thank you, that was really helpful. This topic is solved! :D

2 answers

✓ Accepted answer

Pretty simple :

character["Right Leg"].Transparency = .8
character["Left Leg"].Transparency = .8

Anywho, you could do this if you want all to be .5

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(character)
for i , v in pairs(character:GetChildren()) do
	if v:IsA("BasePart") then
	v.Transparency = .8
			end
		end
	end)
end)

Since names with spaces like Left Arm aren't valid identifiers (they aren't a variable name since they have a space in them) we can't use the . to index them.

Instead, we use explicit indexing using the square brackets

character["Left Arm"].Transparency.

We can compare this to character["Head"].Transparency and character.Head.Transparency

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