local plr = game.Players.LocalPlayer local Char= plr.Character or plr.CharacterAdded:Wait() local UserInputService = game:GetService("UserInputService")
local Tapped = false local Time = 0.25 local Cooldown = false
UserInputService.InputBegan:Connect(function(Input, GameStuff) if GameStuff then return end if Input.KeyCode == Enum.KeyCode.W and Cooldown == false then if not Tapped then Tapped = true wait(Time) Tapped = false else Char.HumanoidRootPart.Velocity = Char.HumanoidRootPart.CFrame.lookVector*400 Cooldown = true wait(2) Cooldown = false end end end)

3 comments
Would be appreciated if you posted the error and formatted the code in a code block
yes
https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site