my script is: i added it to a part which i thought it would only work while you are in a part but it didnt work
game.Players.PlayerAdded:Connect(function(plr) local loaded = plr:HasAppearanceLoaded() while not loaded do wait() loaded = plr:HasAppearanceLoaded() end
local StartingSpeed = 5
local Speed = StartingSpeed
local SpeedMultiplier = 1.002
local Delay = 3
local human = plr.Character:FindFirstChild("Humanoid")
local debounce = false
human.Running:Connect(function(plr)
while human:GetState() == Enum.HumanoidStateType.Running do
wait()
if human.MoveDirection.magnitude > 0 then
if debounce == false then
debounce = true
Speed = Speed * SpeedMultiplier
human.WalkSpeed = Speed
wait(Delay)
debounce = false
end
end
end
end)
plr.CharacterAdded:Connect(function(char)
local humanoid = char:FindFirstChild("Humanoid")
humanoid.WalkSpeed = Speed
humanoid.Running:Connect(function(plr)
while humanoid:GetState() == Enum.HumanoidStateType.Running do
wait()
if humanoid.MoveDirection.magnitude > 0 then
if debounce == false then
debounce = true
Speed = Speed * SpeedMultiplier
humanoid.WalkSpeed = Speed
wait(Delay)
debounce = false
end
end
end
end)
end)
end)

1 comment
Well if it depends on touching a part, you'll need a remote event to do so