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

Commit

Permalink
Fix remaining WalkSpeed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluviolithic committed Nov 14, 2023
1 parent 29efba6 commit e7fdba0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/server/Combat/Enemy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ local function handleEnemy(enemy)
end
end

if not selectors.isPlayerLoaded(store:getState(), player.Name) then
return
end

local weaponName: string = selectors.getEquippedWeapon(store:getState(), player.Name)
local wepaon: Accessory? = if player.Character
then player.Character:FindFirstChild(weaponName) :: Accessory
Expand Down Expand Up @@ -232,7 +236,13 @@ local function handleEnemy(enemy)
end)
)

humanoid.MoveToFinished:Wait()
--humanoid.MoveToFinished:Wait()
--task.wait(player:DistanceFromCharacter(rootPart.Position) / humanoid.WalkSpeed)
repeat
task.wait(0.1)
until player:DistanceFromCharacter(rootPart.Position) <= fightRange + 5
or cleanedUp
or not selectors.isPlayerLoaded(store:getState(), player.Name)

if cleanedUp or (player:DistanceFromCharacter(rootPart.Position) > fightRange + 5) then
return
Expand Down
1 change: 0 additions & 1 deletion src/server/Combat/FearEffects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ store.changed:connect(function(newState, oldState)
task.spawn(trackPlayerScaredStatus, player)
newWalkSpeed += modifiedDebuff
elseif isScared(player.Name, oldState) then
store:dispatch(actions.incrementPlayerStat(player.Name, "WalkSpeed", 4))
newWalkSpeed -= modifiedDebuff
end
local humanoid = if player.Character then player.Character:FindFirstChild "Humanoid" else nil
Expand Down

0 comments on commit e7fdba0

Please sign in to comment.