Oh, for real? Sorry, I didn’t knew that, just thought Local Scripts and Server scripts where Black and White with nothing in between.
Thanks tho!
it works now only problems are: the animation doesnt play and somewhere in the script player is orange underlined and the cooldown doesnt work and when i die i cant dash anymore
it works now only problems are: the animation doesnt play and somewhere in the script player is orange underlined and the cooldown doesnt work and when i die i cant dash anymore
^ any idea why?
EDIT: i got the animation working, i got the error fixed and got the cant dash when die fixed. my only problems are now: COOLDOWN and how do i make the animation stop when i stop dashing? i made a little too long animation so it just keeps going when stopped
Someone help please? I only have two more problems and i can’t seem to fix them
For the Cooldown, you can make a debounce just like the Tapped Variable you made.
local cd = false
if cd == false then
cd = true
–dash code here
wait(cooldowntime)
cd = false
end
You can adjust the speed of the dash animation to fit the dash movement timing, either on the animation editor or setting the speed on the code (Look here for help).
Please try looking the roblox API to find out how to fix those issues, as you are recquiring too much help for a single function. If you start searching for properties, functions and events you might learn more about coding and need less help from people).
I’ll take a look but yeah… though I’m proud of myself I was able to fix all the other bugs without any help, figuring I’m only a lvl 0.0001 scripter
this is what i made with the cooldown, though it doesnt work
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local UserInputService = game:GetService(“UserInputService”)
local Tapped = false
local cd = false
if cd == false then
cd = true
UserInputService.InputBegan:Connect(function(Input, GameStuff)
if GameStuff then return end
if Input.KeyCode == Enum.KeyCode.W then
if not Tapped then
Tapped = true
wait(0.3)
Tapped = false
else
Char.HumanoidRootPart.Velocity = Char.HumanoidRootPart.CFrame.lookVector*330
local Animation = plr.Character:FindFirstChild(“Humanoid”):LoadAnimation(script.Animation)
Animation:Play()
wait(5)
cd = false
end
end
end)
end
You have to put the cd code inside inputbegan event, so it always check and set cooldown when inputbegan is fired, and preferably after checking what keycode was pressed (w).
this is the final working script:
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local UserInputService = game:GetService(“UserInputService”)
local Tapped = false
local cd = false
UserInputService.InputBegan:Connect(function(Input, GameStuff)
if cd == false then
if GameStuff then return end
if Input.KeyCode == Enum.KeyCode.W then
if not Tapped then
Tapped = true
wait(0.3)
Tapped = false
else
Char.HumanoidRootPart.Velocity = Char.HumanoidRootPart.CFrame.lookVector*330
cd=true
local Animation = plr.Character:FindFirstChild("Humanoid"):LoadAnimation(script.Animation)
Animation:Play()
wait(2.5)
cd = false
end
end
end
end)
I am not finding the cd check (if cd == false then) on your code tho. You could put at that else just before setting the velocity of the player. Change (else) to (elseif cd == false then)