Animate Script not working

Hey Developers!
I am making a story game, and for my character, I am making a basic animation script.
Here is the script:

local animIdle = Instance.new('Animation')

animIdle = 'http://www.roblox.com/asset/?id=507766388'

local controller = script.Parent.Humanoid

controller:LoadAnimation(animIdle):Play()

However, I am getting an error in the output:

Screenshot_5

I do not know why this is happening. My character is R15
Any help will be appreciated
Thanks!

change this line:
animIdle = 'http://www.roblox.com/asset/?id=507766388'
to this:
animIdle.AnimationId = 'http://www.roblox.com/asset/?id=507766388'

3 Likes