My run and walk GUI script is not working even though I think it should work?
Asked by
3 years ago Edited 3 years ago
So I was testing a script I was making that was about running and walking and when you press the run button it will say walk then a countdown and then it will put you back to normal speed but if you press the button while the countdown is counting down it will keep counting but will change the walk speed to normal. I tried fixing it but it didn't work.
Here is the script if you wanna help me. ~~~~~~~~~~~~~~~~~
script.Parent.MouseButton1Click:Connect(function()
01 | if script.Parent.Text = = "Run" then |
03 | if script.Parent.Text = = "Walk(3)" or "Walk(2)" or "Walk(1)" and script.Parent.BackgroundColor 3 = = Color 3. fromRGB( 255 , 0 , 0 ) then |
05 | script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16 |
06 | script.Parent.Text = "Run" |
09 | script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 32 |
10 | script.Parent.BackgroundColor 3 = Color 3. fromRGB( 0 , 255 , 0 ) |
11 | script.Parent.Text = "Walk" |
13 | script.Parent.Text = "Walk(3)" |
15 | script.Parent.Text = "Walk(2)" |
17 | script.Parent.Text = "Walk(1)" |
19 | script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16 |
20 | script.Parent.Text = "Run" |
21 | script.Parent.BackgroundColor 3 = Color 3. fromRGB( 255 , 0 , 0 ) |
24 | script.Parent.BackgroundColor 3 = Color 3. fromRGB( 255 , 0 , 0 ) |
25 | script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16 |
26 | script.Parent.Text = "Run" |
end)
~~~~~~~~~~~~~~~~~