Can someone help me I have no clue how to make this. I know how to make separate buttons to run and walk but i want to make it where when you click your walkspeed will become 0 and when you click again you will go back to walkspeed 16. This is not a request site I just want to know some things that can help me create it.
COMMUNITY QUESTION
Can someone help me on how to make a click to run and walk?
1 answer
Maybe you could have two buttons and in each button you add a local script:
Then in each button write the skeleton of the script: Run Button:
script.Parent.MouseButton1Click:Connect(function()
local plr = game.Players.LocalPlayer
plr:WaitForChild("Humanoid").WalkSpeed = 16 -- Changing walkspeed
NoSpeedButton.BackgroundColor3 = BrickColor.new("Really Red") -- This could be to signify that the other button is not working!
script.Parent.BackgroundColor3 = BrickColor.new("Really Green")
end)
No speed button:
script.Parent.MouseButton1Click:Connect(function()
local plr = game.Players.LocalPlayer
plr:WaitForChild("Humanoid").WalkSpeed = 0
NoSpeedButton.BackgroundColor3 = BrickColor.new("Really Green")
script.Parent.BackgroundColor3 = BrickColor.new("Really Red")
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You can do this by looking out for a click on a UI Object such as a button (https://developer.roblox.com/en-us/api-reference/event/GuiButton/MouseButton1Click) then attach a function which changes the humanoid's WalkSpeed property to ( for example: 24 ) then add a debounce which is just a variable that says the walkspeed is on or off.