I have a ButtonGui and when I click it a textlabel counts up by 1's every click. When I click the button 1 time, the walkspeed changes to 1 but if you click it 20 times, walkspeed does not change :(
Plr = game.Players.LocalPlayer
I = Instance.new("IntValue")
I.Parent = Plr
TextL = Plr.PlayerGui.Clicker.TextLabel
Plr.Character.Humanoid.WalkSpeed = 0
I.Changed:connect(function()
TextL.Text = "Clicks: " ..I.Value
end)
script.Parent.MouseButton1Click:connect(function()
I.Value = I.Value + 1
end)
--Problem is below.
while wait(.1) do
if I.Value == 1 then
Plr.Character.Humanoid.WalkSpeed = 1
end
end
while wait(.1) do
if I.Value == 20 then
Plr.Character.Humanoid.WalkSpeed = 20
end
end

2 comments
The intvalue is for the # of clicks.
That is true, but if the number of clicks is the same as your walkspeed, you don't really need to make it.