Having a problem when trying to add a default idle animation for my starter player using the script.
The error message is this: Players.abelgetachew19.PlayerScripts.AnimationHandles:4: attempt to index nil with 'Humanoid' - Client - Animation Handles:4
local FloatingIdle = script.Floating
local player = game.Players.LocalPlayer
local char = player.Character
local hum = char.Humanoid
local FloatingAnimation = hum:LoadAnimation(FloatingIdle)
game.Players.PlayerAdded:Connect(function(startanimation)
if startanimation == true then
FloatingAnimation:Play()
end
end)

3 comments
I'm getting a new error message: "attempt to index nil with 'WaitForChild'"
it's a server script as i understand it. grab the character and the humanoid from the .PlayerAdded event. Also replace "startanimation" with the player (.PlayerAdded only returns the new player)
It fixed the error but the script won't run at all. I give up