You should put this script in StarterPlayer > StarterCharacterScripts. What this will do will allow the script to load along the character ( the scripts load inside the character model in workspace ) and when you do this instead of using...
Humanoid = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
You should use...
Humanoid = script.Parent:FindFirstChild("Humanoid")
But you should only use this when you have put the scirpt in the StarterCharacterScripts as it is already in the model which is why I done that.
****Another thing I saw
Also another thing, I was wondering if you wanted the animation to be seeable by other characters seeing as your game was FliteringEnabled, and if you wanted to do this you should use BindableEvents, https://wiki.roblox.com/index.php?title=API:Class/BindableEvent
This allows two scripts to communicate with each other regardless of it being local, server or module and by using this to your advantage, instead of using...
Animation1:Play()
You should use...
game:GetService("ServerStorage").BindableEvent:Fire(Animation1)
And in another server-script you can receive the firing of the event and play the animation e.g.
game:GetService("ServerStorage").BindableEvent.Event:connect(function(arg1)
arg1:Play()
end)
I hope my answer helped or contributed to you.
~tantec
1 comment
I will try the scripts out