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

Why wont my script make my legs Transparency Equal 1?

Asked by
NexeusX 137
7 years ago
Edited 7 years ago

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

Log in to vote
1
Answered by 7 years ago
Edited 7 years ago

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)

0
Ah ok i see, i made an mistake that overlooked thanks! NexeusX 137 — 7y
0
Did that help? dakanji123 97 — 7y
Ad

Answer this question