Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I check for multiple values and if one is not true then it's false?(More in description)

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.

local BCV = game.Workspace.CP.BC
local GuestV = game.Workspace.CP.Guest
local TixV = game.Workspace.CP.Tix
local cpl = game.Workspace.CPL

while true do
	wait(1)
		if BC.Value == true and Guest.Value == true and Tix.Value == true then
		cpl.Fire.Enabled = true
			elseif --I don't know if there's anything I need to add to check if any of the values are false
			cpl.Fire.Enabled = false
end
end
end

1 answer

✓ Accepted answer

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

local BCV = game.Workspace.CP.BC
local GuestV = game.Workspace.CP.Guest
local TixV = game.Workspace.CP.Tix
local cpl = game.Workspace.CPL

while true do
    wait(1)
        if BC.Value == true and Guest.Value == true and Tix.Value == true then
        cpl.Fire.Enabled = true
            else
            cpl.Fire.Enabled = false
end
end
end

Here is the long way

local BCV = game.Workspace.CP.BC
local GuestV = game.Workspace.CP.Guest
local TixV = game.Workspace.CP.Tix
local cpl = game.Workspace.CPL

while true do
    wait(1)
        if BC.Value == true and Guest.Value == true and Tix.Value == true then
        cpl.Fire.Enabled = true
            elseif  BC.Value == false or Guest.Value == false or Tix.Value == false then
            cpl.Fire.Enabled = false
end
end
end

Hope this helped!

2 comments

0

Thank you, I appreciate the help!

0

Sorry it took so long to accept the answer, I was having problems with my internet last night.

This discussion is preserved as it was. New answers, comments, and votes are closed.