I'm making a script where u click a button and it plays the animation. Something is wrong and here is the code:
local plr = game.Players.LocalPlayer local char = plr.Character or plr.CharacterAdded:wait() local hum = char.Humanoid local idle = hum:LoadAnimation(script.Animation) script.Parent.MouseButton1Click:Connect(function() idle:Play() end)
the system says there is something wrong with line 3 but I have no clue what it is
I think it's because the Humanoid hasn't loaded up yet, but not sure.
local hum = char:WaitForChild("Humanoid")