I'm not exactly sure how to word the title so I hope the description and my idea of how it's going work will help. How do I check for more than one value as is equal to true then andif one or more is not then? I would like to run this constantly checking the values. Thank you for the help in advance. I appreciate it.
01 | local BCV = game.Workspace.CP.BC |
02 | local GuestV = game.Workspace.CP.Guest |
03 | local TixV = game.Workspace.CP.Tix |
04 | local cpl = game.Workspace.CPL |
05 |
06 | while true do |
07 | wait( 1 ) |
08 | if BC.Value = = true and Guest.Value = = true and Tix.Value = = true then |
09 | cpl.Fire.Enabled = true |
10 | elseif --I don't know if there's anything I need to add to check if any of the values are false |
11 | cpl.Fire.Enabled = false |
12 | end |
13 | end |
14 | end |
Well there a two ways of doing this. A long way, and a short way. The long way is more specific than the short way.
Here is the short way
01 | local BCV = game.Workspace.CP.BC |
02 | local GuestV = game.Workspace.CP.Guest |
03 | local TixV = game.Workspace.CP.Tix |
04 | local cpl = game.Workspace.CPL |
05 |
06 | while true do |
07 | wait( 1 ) |
08 | if BC.Value = = true and Guest.Value = = true and Tix.Value = = true then |
09 | cpl.Fire.Enabled = true |
10 | else |
11 | cpl.Fire.Enabled = false |
12 | end |
13 | end |
14 | end |
Here is the long way
01 | local BCV = game.Workspace.CP.BC |
02 | local GuestV = game.Workspace.CP.Guest |
03 | local TixV = game.Workspace.CP.Tix |
04 | local cpl = game.Workspace.CPL |
05 |
06 | while true do |
07 | wait( 1 ) |
08 | if BC.Value = = true and Guest.Value = = true and Tix.Value = = true then |
09 | cpl.Fire.Enabled = true |
10 | elseif BC.Value = = false or Guest.Value = = false or Tix.Value = = false then |
11 | cpl.Fire.Enabled = false |
12 | end |
13 | end |
14 | end |
Hope this helped!