How to make an automatic running system?

So recently me and my friend have been working on an unannounced game but we’ve come across a problem.

How on earth do you make an automatic running system? Not a shift-to-sprint type thing, but the player is automatically running and can’t stop. I can’t find any sort of tutorial, I’ve looked up many key words, nothing. If any of y’all have anything you could reference me to that would be great!

Note: I am not asking for a full script, just some resources.

4 Likes

you mean toggle to run? like click once and player be in run mode and click again and player be in walk mode?

1 Like

No. It’s hard to explain… I want the player to be running and unable to stop running. It’s kind of like subway surfers or temple run.

you can maybe do

game.Players.LocalPlayer:Move(Vector3.new(1,0,0))

put this in a local script and put it in the starterplayer and name it ControlScript
must be named correctly to work

try now as i changed some error i did lol

did it work?

image

I’m guessing I would do “:WaitForChild:” then right

while true do
	wait(0.04)
	game:GetService("Players").LocalPlayer:Move(Vector3.new(1,0,0))
end

Put this in StarterPlayer → StarterPlayerScripts as a LocalScript

NOTE: This will run forever and it will just run straight, you cant move your camera to the direction you want your character to move.

You can customize how far it will go by changing the Vector3.new. Also you can customize the wait().

1 Like

ah yes you should use waitforchild i forgot about that

I just added a wait(3) instead and it works perfectly

uhh dont do that as sometimes people character might load slowly as internet problems so its better to use waitforchild player

i did wait for child and it said “infinite yield possible on waitforchild:localplayer”

anyway is there a way that the player can still jump with this script?

Yes. My script will allow jumping but read the note. (Basically both scripts will)

Tried yours, doesn’t allow jumping.

Really? Worked for me, weird.

30c…

it worked for you since yours you didnt name it ControlScript if you do name it it will override the default controls

1 Like

Oh right. I actually didn’t know that, haha!

local plr=game.Players.LocalPlayer
local hum=plr.Character.Humanoid
game:GetService("RunService").RenderStepped:Connect(function()
   plr:Move(Vector3.new(1,0,0))
end
local uis=game:GetService("UserInputService")
uis.InputBegan:Connect(function(input)
   if input.KeyCode == Enum.KeyCode.Spacebar then
      hum.Jump=true
   end
end)

jump included and also infinite moving

1 Like

no sure if the enum is correct or not so check that out

image