I'm making a speed meter gui that makes certain image labels only visible when a player reaches a certain speed. My problem is when the player slows down in speed the gui doesn't update until the player presses another button. I tried using elseif statements, but I got the same result.
local dude = script.Parent
local disguy = game.Players.LocalPlayer.PlayerGui.ScreenGui1:WaitForChild("SpeedCounterFrame")
dude.Running:connect(function()
if dude.WalkSpeed < 30
then
disguy.SpeedCounter1.Visible = false
end
end)
dude.Running:connect(function()
if dude.WalkSpeed > 30 then
disguy.SpeedCounter1.Visible = true
end
end)
dude.Running:connect(function()
if dude.WalkSpeed < 60 then
disguy.SpeedCounter2.Visible = false
end
end)
dude.Running:connect(function()
if dude.WalkSpeed > 60 then
disguy.SpeedCounter2.Visible = true
end
end)
dude.Running:connect(function()
if dude.WalkSpeed < 90 then
disguy.SpeedCounter3.Visible = false
end
end)
dude.Running:connect(function()
if dude.WalkSpeed > 90 then
disguy.SpeedCounter3.Visible = true
end
end)
dude.Running:connect(function()
if dude.WalkSpeed < 6000 then
disguy.SpeedCounterHighest.Visible = false
end
end)
dude.Running:connect(function()
if dude.WalkSpeed > 6000 then
disguy.SpeedCounterHighest.Visible = true
end
end)

5 comments
Why do you have all those different ifs in multiple separate functions? Why not put them all in one function, instead of creating multiple for each to check the WalkSpeed? It doesn't make any sense.
That's what his question is for...
Try using the Changed event instead of the Running event.
Thank you @Percil
Running (and Changed) are events, so if they don't happen sometimes, neither will your function. Use loops.