Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Dash script stops working after someone dies. How can I fix this?

Asked by 4 years ago

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)
0
where is the script? ProjectInfiniti 192 — 4y
0
you should put this in starter player scripts ProjectInfiniti 192 — 4y
0
Forgot to mention that, sorry. It is in starter player scripts. Eveyrthing works just fine it's just when you die it stops working l3ig_Boss 4 — 4y

Answer this question