local Debounce = false
local IdleAnim = Instance.new("Animation")
IdleAnim.AnimationId = "rbxassetid://14813772308"
local firstTrack
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://13383682135"
local track
local character
tool.Equipped:Connect(function()
firstTrack = script.Parent.Parent.Humanoid:LoadAnimation(IdleAnim)
firstTrack.Priority = Enum.AnimationPriority.Action
firstTrack.Looped = false
firstTrack:Play()
character = tool.Parent
character.Humanoid.WalkSpeed = 0
character.Humanoid.JumpPower = 0
wait(1)
end)
tool.Activated:Connect(function()
if not Debounce then
Debounce = true
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = false
track:Play()
wait(1)
Debounce = false
end
end)
tool.Unequipped:Connect(function()
if firstTrack then
firstTrack:Stop()
character.Humanoid.WalkSpeed = 16 -- the default speed
character.Humanoid.JumpPower = 50 -- the default jump power
end
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
character.Humanoid.WalkSpeed = 16 -- the default speed
character.Humanoid.JumpPower = 50 -- the default jump power
end
end)
i added a Debounce to the Activated event, is that what you wanted?