Hey all!
Recently I’ve been messing with ROBLOX’s physics and making cool stuff, like custom animations, wall sliding, diving, and more!
But I wanted to make a “slowly gain walkspeed when walking” script, and each time I tried to make one it wouldn’t work.
To do this add a script inside server script service and add the following:
P.S. this script allows you to make the player’s walkspeed higher by 1 every second.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character.Humanoid
while wait(1) do
humanoid.WalkSpeed = humanoid.WalkSpeed + 1 --you can change the number to what you desire
print("Increased")
end
end)
end)
This is a quick script I whipped up inside the server script service.
Not sure if this is what you wanted, but you can use it if you want.
Oops sorry:
local Player = game.Players.LocalPlayer
local Character = game.Players.LocalPlayer.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild(“Humanoid”)
local IsWalking = IsWalkingListner(Humanoid)
while true do
wait()
if IsWalking() then
Humanoid.WalkSpeed = Humanoid.WalkSpeed
wait(1)
end
end
You can use Humanoid.Running:Wait() to change the walkspeed while humanoid is walking:
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.WalkSpeed = 1
while true do
Humanoid.Running:Wait()
wait(1)
Humanoid.WalkSpeed += 1
end
Then you can check player’s Velocity to determine if player is walking or not.
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character.HumanoidRootPart
Humanoid.WalkSpeed = 16
while true do
if HumanoidRootPart.Velocity.X == 0 and HumanoidRootPart.Velocity.Z == 0 then
Humanoid.WalkSpeed = 16
Humanoid.Running:Wait()
else
wait(1)
Humanoid.WalkSpeed += 1
end
end