What would I put in a script to make when the character moves it picks up speed? Would I use a loop to add to the players speed by increments?
local hum = script.Parent:WaitForChild("Humanoid") local torso = nil --check rig type if hum.RigType == "R6" then torso = script.Parent.Torso else torso = script.Parent.UpperTorso end while wait() do --put a number in the () if you want to slow down speed incerasing if torso.Velocity.Magnitude > 1 then hum.WalkSpeed = hum.WalkSpeed + 0.1 --this is how the walkspeed incerases else hum.WalkSpeed = 16 --default walkspeed end end
Put this into StarterCharacterScripts. Works with R6 and R15.
You should indeed use loops and use increments, It isn't done completely in a loop because it would add to the speed when the player isn't moving, script is below, the explenation is too, if you need some more explanation, feel free to ask (btw mark this as answered please xD)
Script needs to be in workspace
Increment = 1 -- It will become this much faster every time DelayT = 0.1 -- It will wait this time before it starts the loop again defSpeed = 5 -- Starterspeed, this number will change trough the loop maxSpeed = 100 -- If you don't want this set it to 99999999999999999999999 or something like that xD Speed = defSpeed plrWalking = false game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) player.Character.Humanoid.Running:connect(function(speed) if speed > 0 then -- player isn't standing still plrWalking = true else plrWalking = false end end) end) end) while wait(DelayT) do for index, player in pairs(game.Players:GetPlayers()) do char = player.Character or player.CharacterAdded:wait() hum = char:WaitForChild("Humanoid") if hum and plrWalking and Speed < maxSpeed then -- if humanoid and player is walking print("plr is running") Speed = Speed + Increment hum.WalkSpeed = Speed -- increasing speed elseif not plrWalking then Speed = defSpeed hum.WalkSpeed = defSpeed -- reset speed when stopped end end end