Is there something i'm doing wrong?
local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Tool = script.Parent local Equipped = false --/ Animation Controler local CurrentAnim = nil local Animation = nil local Animations = { Swing = "http://www.roblox.com/asset/?id=2560427208", } function animate(Key) if Animations[Key] then Animation = Instance.new("Animation") Animation.AnimationId = Animations[Key] local AnimTrack = Character.Humanoid:LoadAnimation(Animation) AnimTrack:Play() CurrentAnim = AnimTrack AnimTrack.Stopped:Connect(function() CurrentAnim = nil AnimTrack:Destroy() Animation = nil end) end end --/ Functions Tool.Equipped:Connect(function() print("Equipped "..Tool.Name) Equipped = true end) Tool.Unequipped:Connect(function() print("Unequipped "..Tool.Name) Equipped = false end) Tool.Activated:Connect(function() print("Activated "..Tool.Name) if Equipped then animate("Swing") print("Animated") end end)
It doesn't print Any Errors.
Make sure your animation level is "Action", action is the most prioritized animations and will play over movement, idle, and core.
The levels go as such...
Action -- Highest
Movement
Idle
Core -- Lowest
Go to the priority section of this page