How can i make a slider gui that changes my walk speed

I don’t know how to make a script that when i sldie the slider thing it will change my walk speed, How can i do it. It is for my games gamepass

I think you could use the Scrolling Frame and when you scroll on it the canvas position will change so maybe you can make a formula that takes that number that changes and make your speed increase and decrease

Put in your own math but that’s how id go about it

indent preformatted text by 4 spaces

local characterSpeed
local scrollValue
local openButtonSpeed = script.Parent.Parent

openButtonSpeed.Event:Connect(function(index)
    while script.Parent.Visible == true do
	    scrollValue = script.Parent.CanvasPosition.Y
	    if scrollValue / 4 <= 10 then
		    characterSpeed = 10
	    else
	            characterSpeed = scrollValue / 4
    	    end

	    game.StarterPlayer.CharacterWalkSpeed = characterSpeed

	    wait(1)
    end
end)
1 Like