Answered by
6 years ago Edited 6 years ago
Try this.
01 | local dude = script.Parent |
02 | local disguy = game.Players.LocalPlayer.PlayerGui.ScreenGui 1 :WaitForChild( "SpeedCounterFrame" ) |
04 | dude:GetPropertyChangedSignal( "WalkSpeed" ):connect( function () |
05 | if dude.WalkSpeed < = 30 then |
06 | disguy.SpeedCounter 1. Visible = false |
08 | if dude.WalkSpeed > = 30 then |
09 | disguy.SpeedCounter 1. Visible = true |
11 | if dude.WalkSpeed < = 60 then |
12 | disguy.SpeedCounter 2. Visible = false |
14 | if dude.WalkSpeed > = 60 then |
15 | disguy.SpeedCounter 2. Visible = true |
17 | if dude.WalkSpeed < = 90 then |
18 | disguy.SpeedCounter 3. Visible = false |
20 | if dude.WalkSpeed > = 90 then |
21 | disguy.SpeedCounter 3. Visible = true |
23 | if dude.WalkSpeed < = 6000 then |
24 | disguy.SpeedCounterHighest.Visible = false |
26 | if dude.WalkSpeed > = 6000 then |
27 | disguy.SpeedCounterHighest.Visible = true |
The thing that caused you to fail is that Running
fires directly after they start/stop, and if you have some sort of speed fading script, it stacks directly with this one, and fires at the exact time that this one does (assuming that the fading script uses Humanoid.Running
, which WOULD be the most efficient way). With dude:GetPropertyChangedSignal("WalkSpeed")
, it will fire every time that dude.WalkSpeed
changes.
PS: Use the SAME function for stuff if you're gonna use the same function every time. It really helps to shorten up the code, as well as reduce lag!