Help to script walkspeed

No apologies are necessary.

Try this in a localscript that is parented under the button


local button = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")

local defaultSpeed = humanoid.WalkSpeed
local fastSpeed = defaultSpeed * 2
humanoid.WalkSpeed = fastSpeed
	
local enabled = true --button is started in ON position, so the player will walk at fast speed

button.MouseButton1Click:Connect(function()
	if enabled then --turn button OFF , player will walk at defaultSpeed
		humanoid.WalkSpeed = defaultSpeed
		enabled = false
	else --turn button ON , player will walk at fast speed
		humanoid.WalkSpeed = fastSpeed
		enabled = true
	end
end)


![image|191x73](upload://5TrmXpuPI6zG13uoUmcSaVZPoFQ.png)

I checked your script is not working

Can you describe how it is not working?
Does it give an error message?
What is it doing wrong?
Is it doing nothing?

I click on the button, it doesnā€™t work anymore, it doesnā€™t even give out an error.

With the trouble of different languages and using a translator, you might need to find someone who can Collaborate with you, using Team Create.
So they can see the script and the gui and everything working or not working together.

1 Like

Okay I understand you thanks for trying to help me

I think this may be a the bigger problem. The script I posted works perfectly and Iā€™ve been using it for years. But, it needs to be installed correctly. Other than that it takes care of everything by itself.

bro, I do not know how to use tipo, I installed it further, I do not know how to do it, can you give me a script?

It couldnā€™t be any more easy ā€¦
#1. Download the file
#2 Open your program and go down to StarterPlayer.StarterPlayerScripts, right click on that and insert from file. Add the download ā€¦

Thatā€™s it, you donā€™t need to do anything else ā€¦ hit play.
Itā€™s an all in one script and it will make itā€™s own Gui.

what program are you talking about?

The one I posted here a few comments back ā€¦ click on that.
ā€œOpen your programā€ is the program youā€™re working on in the Roblox Studio.

This download comes with padding for the correct screen placement. You need the whole thing not just the script.

here is the error
([1] ŠŠ»ŃŒŠ±Š¾Š¼ (5.1 ŠšŠ‘) ā€” ŠŠøŠ½Š“Š·Ń)

application not found

There is no errors ā€¦ somehow youā€™re not adding this to your program correctly.
If you donā€™t know how to insert a file, I donā€™t know what to say ā€¦
If you have anything else trying to do this take it out while testing.

That is a blank picture in your link.

bro, it doesnā€™t work the way I wanted, sorry, I need the speed to be equal to 16 when pressed and again when pressed again, the speed became the same as the player had

It keys off what the players speed was when the game started.
The sprint is set to * 1.5 of that ā€¦ You can edit this also.

local DefaultSpeed = Humanoid.WalkSpeed
local SprintSpeed = tonumber(DefaultSpeed) * 1.5

Change these to ā€¦

local DefaultSpeed = 8 -- or whatever you want
local SprintSpeed = 16 -- or whatever you want

Bro it works but when I run the speed comes back can you help with that?

I can throw off a video clip as it happens

If you hold delete and sprint, when you let off delete it will go back to the normal speed.
If you click the icon it will stay sprinting ā€¦ unless you press delete or click the icon again.

Hereā€™s a mistakeIā€™m throwing off the video right now

@2112Jay pls help me the fixing promblem

1 Like