attempt to index nil with 'LeftLowerLeg'? What does this mean?
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.
1 | local Y = Instance.new( "Weld" ) |
2 | Y.Part 0 = player.Character.LeftLowerLeg |
4 | Y.C 0 = CFrame.new( 0 , 0 , 0 ) |
here is the whole script
01 | local Skate = workspace.IceSkates |
02 | game.Players.PlayerAdded:connect( function (player) |
03 | local g = Skate.Leg 1 :clone() |
04 | g.Parent = player.Character |
05 | local C = g:GetChildren() |
07 | if C [ i ] .className = = "Part" then |
08 | local W = Instance.new( "Weld" ) |
11 | local CJ = CFrame.new(g.Middle.Position) |
12 | local C 0 = g.Middle.CFrame:inverse()*CJ |
13 | local C 1 = C [ i ] .CFrame:inverse()*CJ |
18 | local Y = Instance.new( "Weld" ) |
19 | Y.Part 0 = player.Character.LeftLowerLeg |
21 | Y.C 0 = CFrame.new( 0 , 0 , 0 ) |
25 | local h = g:GetChildren() |
28 | h [ i ] .CanCollide = false |
31 | local g = Skate.Leg 2 :clone() |
32 | g.Parent = player.Character |
33 | local C = g:GetChildren() |
35 | if C [ i ] .className = = "Part" then |
36 | local W = Instance.new( "Weld" ) |
39 | local CJ = CFrame.new(g.Middle.Position) |
40 | local C 0 = g.Middle.CFrame:inverse()*CJ |
41 | local C 1 = C [ i ] .CFrame:inverse()*CJ |
46 | local Y = Instance.new( "Weld" ) |
47 | Y.Part 0 = player.Character.RightLowerLeg |
49 | Y.C 0 = CFrame.new( 0 , 0 , 0 ) |
53 | local h = g:GetChildren() |
56 | h [ i ] .CanCollide = false |