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)