I was testing this with a frend in the game, and we learned that the script works fine, until you die/reset, then you can't use the dash feature. Here's the script, could anyone tell me if I did something wrong here?
local player = script.Parent.Parent
local debounce = false
local char = player.Character or player.CharacterAdded:Wait()
local uis = game:GetService("UserInputService")
local hum = char:WaitForChild("Humanoid")
local length = .2
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://5100521622"
local didpress = false
local SOUN = script:WaitForChild("DashSound")
uis.InputBegan:Connect(function(input, istyping)
if istyping then return end
if input.KeyCode == Enum.KeyCode.E then
if not debounce then
if not didpress then
didpress = true
wait(.2)
didpress = false
else
debounce = true
local bv = Instance.new("BodyVelocity", char:WaitForChild("HumanoidRootPart"))
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = char:WaitForChild("HumanoidRootPart").CFrame.LookVector * 85
local playanim = hum:LoadAnimation(anim)
playanim:Play()
SOUN:Play()
wait(.350)
bv:Destroy()
playanim:Stop(.8)
wait(.650)
debounce = false
end
end
end
end)

3 comments
where is the script?
you should put this in starter player scripts
Forgot to mention that, sorry. It is in starter player scripts. Eveyrthing works just fine it's just when you die it stops working