i tried making an animation command but it says this. what should i do now? here's the script:
local player = game.Players.LocalPlayer local char = player.Character local hum = char:WaitForChild("Humanoid") local point = script.Animation local Prefix = "!" local point = hum:LoadAnimation(script.Animation) player.Chatted:Connect(function(msg) if msg:Sub(1,6) == Prefix.."point" then point:Play() end end)
The Character
is nil. To get the character to not be nil you have to do this.
local player = game.Players.LocalPlayer local char = player.Character if not Character or not Character.Parent then Character = game.Players.LocalPlayer.CharacterAdded:Wait() end local hum = char:WaitForChild("Humanoid") local point = script.Animation local Prefix = "!" local point = hum:LoadAnimation(script.Animation) player.Chatted:Connect(function(msg) if msg:Sub(1,6) == Prefix.."point" then point:Play() end end)
Hope this helps! :)