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

Why wont my script make my legs Transparency Equal 1?

This script only works on my Left Leg, but not my Right Leg won't turn invisible, did i spell something wrong?

script.Parent.Touched:connect(function(hit)
	if hit.Parent.Humanoid then
		--Character Body Parts
		LeftUpperLeg = hit.Parent.LeftUpperLeg
		LeftLowerLeg = hit.Parent.LeftLowerLeg
		LeftFoot = hit.Parent.LeftFoot
		
		RightUpperLeg = hit.Parent.LeftUpperLeg
		RightLowerLeg = hit.Parent.LeftLowerLeg
		RightFoot = hit.Parent.RightFoot
		
			LeftUpperLeg.Transparency = 1
			LeftLowerLeg.Transparency = 1
			LeftFoot.Transparency = 1
		
			RightUpperLeg.Transparency = 1
			RightLowerLeg.Transparency = 1
			RightFoot.Transparency = 1





end	
end)

1 answer

✓ Accepted answer

I'm 80 percent sure that this is your problem

    RightUpperLeg = hit.Parent.LeftUpperLeg

    RightLowerLeg = hit.Parent.LeftLowerLeg

    RightFoot = hit.Parent.RightFoot

Here is the problem

RightUpperLeg should equal hit.Parent.RightUpperLeg instead of LeftUpperLeg and RightLowerLeg shoud equal hit.Parent.RightLowerLeg instead of LeftLowerLeg

Your Right Upper and Right Lower are equal to Left Upper and Left Lower.

The transparency for your LeftUpper and LeftLower are the only changing results because there is nothing here that changes the transparency for your RightLowerLeg and RightUpperLeg

RightUpperLeg should be equal to RightUpperLeg

and

RightLowerLeg should be equal to RightLowerLeg

Your script should look like this

script.Parent.Touched:connect(function(hit)

if hit.Parent.Humanoid then

    --Character Body Parts

    LeftUpperLeg = hit.Parent.LeftUpperLeg

    LeftLowerLeg = hit.Parent.LeftLowerLeg

    LeftFoot = hit.Parent.LeftFoot



    RightUpperLeg = hit.Parent.RightUpperLeg

    RightLowerLeg = hit.Parent.RightLowerLeg

 RightFoot = hit.Parent.RightFoot



        LeftUpperLeg.Transparency = 1

        LeftLowerLeg.Transparency = 1

        LeftFoot.Transparency = 1



        RightUpperLeg.Transparency = 1

        RightLowerLeg.Transparency = 1

        RightFoot.Transparency = 1

end

end)

2 comments

0

Ah ok i see, i made an mistake that overlooked thanks!

0

Did that help?

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