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

Commit

Permalink
Fix issue with idle animation staying after combat
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluviolithic committed Dec 20, 2023
1 parent ae622a9 commit 2b7e1d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/server/Combat/Enemies/ApplyPlayerAnimations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local ServerScriptService = game:GetService "ServerScriptService"
local Remotes = require(ReplicatedStorage.Common.Remotes)
local Janitor = require(ReplicatedStorage.Common.lib.Janitor)
local store = require(ServerScriptService.Server.State.Store)
local actions = require(ServerScriptService.Server.State.Actions)
local selectors = require(ReplicatedStorage.Common.State.selectors)
local formatter = require(ReplicatedStorage.Common.Utils.Formatter)
local animationUtilities = require(ReplicatedStorage.Common.Utils.AnimationUtils)
Expand Down Expand Up @@ -95,6 +96,8 @@ return function(player, enemy, info, janitor)
oldEquippedWeaponAccessory:Destroy()
end

store:dispatch(actions.combatBegan(player.Name))

if weaponName ~= "Fists" then
local weaponAccessory = weapons[weaponName]:Clone()
player.Character.Humanoid:AddAccessory(weaponAccessory)
Expand Down Expand Up @@ -195,6 +198,10 @@ return function(player, enemy, info, janitor)
animationTrack.Stopped:Wait()
animationTrack:Destroy()

if info.HealthValue.Value <= 0 then
break
end

loadedIdleAnimation:Play()

task.wait(animationUtilities.getPlayerAttackSpeed(player))
Expand Down

0 comments on commit 2b7e1d8

Please sign in to comment.