So, to make this simple, this script is like a adding number script, but once it gets to the
1 | break end |
then it stops and does the code below. But i have having some problems as once it gets to the
1 | or Charing = = false then |
It doesnt print the code under below. Is there a simple fix for this?
01 | local Player = game.Players.LocalPlayer |
02 | local Charge = 0 |
03 | local Charing = false |
04 | local UIS = game:GetService( "UserInputService" ) |
05 |
06 | UIS.InputBegan:connect( function (input) |
07 | if input.KeyCode ~ = Enum.KeyCode.H then return end ; |
08 | Charing = true |
09 | game:GetService( "Chat" ):Chat(Player.Character.Head, "HERE I GO..." ) |
10 | while Charing = = true do |
11 | print (Charge) |
12 | Charge = Charge+ 1 |
13 | if Charge = = 120 or Charing = = false then |
14 | print ( "aaa" ) |
15 | game:GetService( "Chat" ):Chat(Player.Character.Head, "HA!" ) |
You could ditch the or
and just use an elseif
statement instead:
01 | local Player = game.Players.LocalPlayer |
02 | local Charge = 0 |
03 | local Charing = false |
04 | local UIS = game:GetService( "UserInputService" ) |
05 |
06 | UIS.InputBegan:connect( function (input) |
07 | if input.KeyCode ~ = Enum.KeyCode.H then return end ; |
08 | Charing = true |
09 | game:GetService( "Chat" ):Chat(Player.Character.Head, "HERE I GO..." ) |
10 | while Charing = = true do |
11 | print (Charge) |
12 | Charge = Charge+ 1 |
13 | if Charing = = false then |
14 | print ( "aaa" ) |
15 | game:GetService( "Chat" ):Chat(Player.Character.Head, "HA!" ) |