Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Add animation fixes to dummies and workout
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluviolithic committed Nov 24, 2023
1 parent 6ca70a4 commit 82779cc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/server/Combat/Dummy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ local function handleDummy(dummy)

local currentAnimation, currentTrack = nil, nil
local animationInstances = getSortedAnimationInstances(animations.Fists:GetChildren())
local idleAnimation = ReplicatedStorage.CombatAnimations.Fists.Idle
local loadedIdleAnimation = humanoid:LoadAnimation(idleAnimation)
local runAnimations = true

local currentIndex, maxIndex = 0, #animationInstances

loadedIdleAnimation.Priority = Enum.AnimationPriority.Idle
task.spawn(function()
while
runAnimations
Expand All @@ -104,6 +108,9 @@ local function handleDummy(dummy)
currentTrack:Play()
currentTrack.Stopped:Wait()
currentTrack:Destroy()

loadedIdleAnimation:Play()

if
selectors.getStat(store:getState(), player.Name, "CurrentFearMeter")
== selectors.getStat(store:getState(), player.Name, "MaxFearMeter")
Expand All @@ -112,7 +119,11 @@ local function handleDummy(dummy)
else
task.wait(getPlayerAttackSpeed(player))
end

loadedIdleAnimation:Stop()
end

loadedIdleAnimation:Destroy()
end)

task.spawn(function()
Expand Down
11 changes: 11 additions & 0 deletions src/server/Exchange/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ local function handlePunchingBag(bag: any)
end)

local currentIndex, maxIndex = 0, #animationInstances
local idleAnimation = ReplicatedStorage.CombatAnimations.Fists.Idle
local loadedIdleAnimation = humanoid:LoadAnimation(idleAnimation)
loadedIdleAnimation.Priority = Enum.AnimationPriority.Idle

task.spawn(function()
repeat
currentIndex = (currentIndex % maxIndex) + 1
Expand All @@ -101,8 +105,15 @@ local function handlePunchingBag(bag: any)
currentTrack:Play()
currentTrack.Stopped:Wait()
currentTrack:Destroy()

loadedIdleAnimation:Play()

task.wait(workoutSpeed)

loadedIdleAnimation:Stop()
until cancelled

loadedIdleAnimation:Destroy()
end)

while
Expand Down

0 comments on commit 82779cc

Please sign in to comment.