Animations have a delay before playing

Hello. I have a script where an animation plays when I press (key), and sometimes the animation has a .5 / 1 second delay before playing it. Is there any ways I can fix this?

Can you include the code that is loading and playing the animation.

local rp = game:GetService("ReplicatedStorage")
   local Jump = rp:WaitForChild("TheWorldRemotes"):WaitForChild("StandJump")

   Jump.OnServerEvent:Connect(function(Player)
local Stand = workspace:FindFirstChild(Player.Name.." Stand"):WaitForChild("Dummy")

if Stand then
		
	local character = script.Parent
	local humanoid = character:WaitForChild("Humanoid")
	
	local animControl = Stand:WaitForChild("AnimControl")
    local StandJump = animControl:LoadAnimation(script:WaitForChild("StandJump"))
    StandJump:Play()
	
	wait(0.6)
	
	humanoid.JumpPower = 150
	humanoid.Jump = true
	wait(2)
	humanoid.JumpPower = 50
	end
end)

If you are looking for answer here, please look here: