I’m looking to create a script: the more you walk, the more you get faster until you’re at a certain speed, and when you stop, it stops the speed and you have to restart running.
Is there a chance there could be a script for that? If so, please kindly give the whole script (I’m fairly new at scripting so there’s no chance I can understand only bits of information for the script).
For conclusion, if you don’t understand what I mean, let me put it in context for you: The longer time you walk, you speed up so that you’re faster than what you originally started. It stops the fast speed and you have to restart running to regain the speed.
Thank you for your help, but unfortunately it won’t work. I forgot to mention that I want the script to work on players that have a char to be a character/model. Is there any other script I could use to solve my problem?
Put this in a local script in StarterPlayer/StarterCharacterScripts
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
while task.wait() do
if humanoid.MoveDirection == Vector3.new() then
humanoid.WalkSpeed = 12
else
humanoid.WalkSpeed += 1
end
end
but move direction doesn’t change over time and would fire non-linearly. from my understanding they want the speed to gain over time, not the more you change direction.
GetPropertyChangedSignal() only emits if its a large value (im not sure why but due to this feature people made an teleport detection using CFrame getpropertychangedsignal on cframe)
This is incorrect, GetPropertyChangedSignal() emits when the property is changed; with MoveDirection it will be a unit circle (x, z).magnitude <= 1 or less if using analog controls this is useful for changes when you only care about when the player’s movement direction changes. I’ve found use for it in simple custom controls for physics objects, changing a Vector force to match the movement direction instantly makes a simple physics based movement system for whatever it is attached to. For this example it doesn’t make sense as we don’t care what direction the player is going, just how long they have been moving.