Hello! I am experiencing an issue when using the evasive in my game. When I dash normally, its fine. But when I dash using evasive, you cant walk for around a second after (you can still sprint for some reason).
here is the code snippet of the dash:
elseif canrightdash == true and not sidedashing then
if sidedeb then return end
sidedeb = true
print("sidesd")
local char = game.Players.LocalPlayer.Character
local hum = char:WaitForChild("Humanoid")
--hum:ChangeState(Enum.HumanoidStateType.GettingUp)
if char:GetAttribute("Ragdolled") and char:GetAttribute("hasEvasive") then
evasiverem:FireServer()
elseif char:GetAttribute("Ragdolled") and not char:GetAttribute("hasEvasive") then
return
end
local anim = hum.Animator:LoadAnimation(script.rightdash)
anim:Play()
local lv = Instance.new("LinearVelocity")
lv.Name = "dashlv"
local dashatt = Instance.new("Attachment")
dashatt.Parent = char.HumanoidRootPart
dashatt.Parent = char.HumanoidRootPart
lv.ForceLimitMode = Enum.ForceLimitMode.PerAxis
lv.MaxAxesForce = Vector3.new(100000, 20, 100000)
lv.Parent = dashatt
lv.Attachment0 = dashatt
hum.JumpPower = 0
hum.WalkSpeed = 0
remote:FireServer("during")
for i = 30, 0, -1 do
local results = checker.dashcheck(char)
if i >= 10 then
remote:FireServer("after")
end
if results then
sidedashing = true
hum.JumpPower = 0
hum.WalkSpeed = 0
char.HumanoidRootPart.CFrame = CFrame.lookAlong(char.HumanoidRootPart.Position, workspace.CurrentCamera.CFrame.LookVector * Vector3.new(1, 0, 1))
lv.VectorVelocity = workspace.CurrentCamera.CFrame.RightVector * i * 3
else
sidedashing = false
if lv then
lv.VectorVelocity = Vector3.new(0,0,0)
end
end
task.wait()
end
sidedashing = false
if dashatt then
dashatt:Destroy()
hum.JumpPower = 50
hum.WalkSpeed = 16
end
task.wait(1)
sidedeb = false
And here is the server script for the evasive:
game.ReplicatedStorage:WaitForChild("Remotes").Evasive.OnServerEvent:Connect(function(plr)
local char = plr.Character
for i, v in pairs(char:GetDescendants()) do
if v:IsA("LinearVelocity") then
v:Destroy()
end
end
char:SetAttribute("hasEvasive", false )
stunmod.Stun(char.Humanoid, 0)
ragmod.Ragdoll(char, nil, 0)
task.spawn(function()
task.wait(1)
char:SetAttribute("hasEvasive", true)
end)
end)
here’s a video of the issue:
External MediaThank you in advance!