I was trying to make a spell script (newish to scripting) and I have the chatted event perfect, I just need the script to be global for the chatted event.
Here's what I have:
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == "Fus Ro Dah" or "fus ro dah" or "frd" or "FUS RO DAH" then
print("spell used: fus ro dah")
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=1788538969" -- your id here
local animTrack = player.Character.Humanoid:LoadAnimation(animation) -- chanhe Humanoid to the target's Humanoid
animTrack:Play()
end
end)
end)
It prints my output, no errors or anything for the animation part though.

2 comments
It looks good to me. It may have something to do with the animation's priority (core, idle, movement, etc.) or the animation may be for a different rig type. Did you make the animation yourself?
yeah I did I made it for R15