local IDLEAnimation = Tool:WaitForChild("IDLE")
local BOWAnimation = Tool:WaitForChild("BOW")
local isEquipped = false
local holdingMouse = false
local idleTrack, bowTrack
local function getHumanoidAndLegs()
local Character = Tool.Parent
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
local rightLeg = Character:FindFirstChild("Right Leg")
local leftLeg = Character:FindFirstChild("Left Leg")
return Humanoid, rightLeg, leftLeg
end
local function toggleLegAnchoring(anchored)
local _, rightLeg, leftLeg = getHumanoidAndLegs()
if rightLeg then rightLeg.Anchored = anchored end
if leftLeg then leftLeg.Anchored = anchored end
end
local function playAnimation(animation, looped)
local Humanoid = getHumanoidAndLegs()
if not Humanoid or not animation then return end
local track = Humanoid:LoadAnimation(animation)
track.Looped = looped
track:Play()
return track
end
local function stopAnimation(track)
if track and track.IsPlaying then
track:Stop()
end
end
local function playReverse(track, onComplete)
if track then
track:AdjustSpeed(-1)
local reverseDuration = math.max(0.1, track.Length - track.TimePosition)
task.delay(reverseDuration, function()
if track.TimePosition <= 0 then
if onComplete then
onComplete()
else
toggleLegAnchoring(false)
playIDLEAnimation()
end
end
end)
end
end```
#🙇 Bowing Animation Script Bug (Still Need Help)
11 messages · Page 1 of 1 (latest)
stopAnimation(idleTrack)
idleTrack = playAnimation(IDLEAnimation, true)
toggleLegAnchoring(false)
end
local function playBOWAnimation()
if holdingMouse then return end
holdingMouse = true
stopAnimation(bowTrack)
bowTrack = playAnimation(BOWAnimation, false)
toggleLegAnchoring(true)
bowTrack.Stopped:Connect(function()
if holdingMouse then
bowTrack.TimePosition = bowTrack.Length
bowTrack:AdjustSpeed(0)
end
end)
end
local function stopBOWAnimation()
if bowTrack then
holdingMouse = false
if bowTrack.TimePosition == bowTrack.Length and bowTrack.Speed == 0 then
playReverse(bowTrack, function()
toggleLegAnchoring(false)
playIDLEAnimation()
end)
elseif bowTrack.IsPlaying then
playReverse(bowTrack, function()
toggleLegAnchoring(false)
playIDLEAnimation()
end)
else
toggleLegAnchoring(false)
end
end
end
Tool.Equipped:Connect(function()
isEquipped = true
playIDLEAnimation()
end)
Tool.Unequipped:Connect(function()
isEquipped = false
stopAnimation(idleTrack)
stopAnimation(bowTrack)
toggleLegAnchoring(false)
end)
Tool.Activated:Connect(playBOWAnimation)
Tool.Deactivated:Connect(stopBOWAnimation)
VIDEO: https://gyazo.com/198e7090fe6cb502da319e73c414cdbe
- Tool equip plays
IDLEAnimation BOWAnimationbefore it reaches the end.
VIDEO2: https://gyazo.com/72d983828b252f42e4d55535f6f5dd3e
- Tool equip plays
IDLEAnimation BOWAnimationwhen it reaches the end and reverses to start- Character jumping with anchored legs when tool is equipped and unequipped.
Animation Script Bug
Animation Script Bug Help
@ping me for a response.
🟢 25 ms
** You are now Level 1! **