I made a scrip, it has four local variables. When it runs the third local variable, and prints the name of it, it returns as Workspace?!?!? Why? Can I fix that? Here is my script
wait(1) script.Parent.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() local animation = script.Slash print("loading") local plyr = script.Parent.Parent.Parent.Name print(plyr) local char = workspace:FindFirstChild(plyr) --here is local variable #3 print(char.Name) local anim = char.Humanoid:LoadAnimation(animation) print("done") end) end)
Output1(print): Workspace------------------------------------------------------------------------- Output2:(error)Players.Player.Backpack.Tool.Script:10: attempt to index local 'char' (a nil value) Please help!!! Thank you!!!