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.

1 comment
Thank you! It works perfectly now, did not know about that xd