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

attempt to index nil with 'LeftLowerLeg'? What does this mean?

Asked by 4 years ago

I'm making ice skates for my game and I'm trying to get them on the player but this pops up, "attempt to index nil with 'leftlowerleg'. I don't get it. Here is the part of my script that has it.

1local Y = Instance.new("Weld")
2Y.Part0 = player.Character.LeftLowerLeg
3Y.Part1 = g.Middle
4Y.C0 = CFrame.new(0, 0, 0)
5Y.Parent = Y.Part0

here is the whole script

01local Skate = workspace.IceSkates
02game.Players.PlayerAdded:connect(function(player)
03    local g = Skate.Leg1:clone()
04        g.Parent = player.Character
05        local C = g:GetChildren()
06        for i=1, #C do
07            if C[i].className == "Part" then
08                local W = Instance.new("Weld")
09                W.Part0 = g.Middle
10                W.Part1 = C[i]
11                local CJ = CFrame.new(g.Middle.Position)
12                local C0 = g.Middle.CFrame:inverse()*CJ
13                local C1 = C[i].CFrame:inverse()*CJ
14                W.C0 = C0
15                W.C1 = C1
View all 59 lines...

1 answer

Log in to vote
0
Answered by 4 years ago

It is not finding the "LeftLowerLeg" it is saying that that is a weird thing that I don't know what it is. Maybe try this:

1player.Character:FindFirstChild("LeftLowerLeg")
0
ok Nervousmrmonkey2 118 — 4y
Ad

Answer this question