Everything seems fine on the client, but on the server animations don’t stop playing and overlap with other animations
Footage : https://youtu.be/5uDhjUWM7jg
the footage shows the problem completely I believe
I tested it with a friend too, same anomaly while in the game normally
I don’t know why it could be happening, I searched on the dev forum myself too and couldn’t find any similar issues
...
local scpe = false
function run()
if scriptstate == "crouching" then return end
if plr.Character.Humanoid:GetState() == not Enum.HumanoidStateType.Running or plr.Character.Humanoid:GetMoveVelocity() == Vector3.new(0,0,0) then return end
if scriptstate == "running" then return end
repeat wait() until scpe == false
scriptstate = "running"
scpe = true
if wst == not nil then
wst:Pause()
end
wst = ts:Create(script.imgWS, TweenInfo.new(1), {Value = parameters.RunningWS})
wst:Play()
plr.Character:WaitForChild("Animate").run.RunAnim.AnimationId = animations.run
plr.Character:WaitForChild("Animate").walk.WalkAnim.AnimationId = animations.run
plr.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
script.imgJP.Value = parameters.RunningJP
scpe = false
end
function nrun() --return to walking
if scriptstate == "crouching" then return end
if scriptstate == not "running" then return end
repeat wait() until scpe == false
scpe = true
if wst == not nil then
wst:Pause()
end
wst = ts:Create(script.imgWS, TweenInfo.new(0.5), {Value = parameters.NeutralWS})
wst:Play()
plr.Character:WaitForChild("Animate").run.RunAnim.AnimationId = animations.Walk
plr.Character:WaitForChild("Animate").walk.WalkAnim.AnimationId = animations.Walk
plr.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
script.imgJP.Value = parameters.NeutralJP
scpe = false
scriptstate = "neutral"
end
...
up there in the code block, is the part of the script that mainly handles the running functionality including animations
The crouching part is the same as this one, just the values and animations are different
The crouching functions set the idle animation too as an extra
I thought about instead of replacing the animations in the animate script I just play the animations but then the crouching part would be a little more complicated
If anybody has solutions or tips to improve the script please do reply
I can provide more detail on the script if needed
I ended up rewriting it completely, it works now