Trouble Using Or Statement

Im Trying to Check to See if a players AFK Tag is false or true. It Does not remove then from the table but the IntroTag One removes/adds though.

local plrs = {}
        	
        	for i, player in pairs (game.Players:GetPlayers()) do
				  if player.IntroTag.Value == false or player.AFK.Value == false then 
        			table.insert(plrs,player)--Add each players into plrs table
        			print(player)
        		elseif player.IntroTag.Value == true or player.AFK.Value == true then
					warn(player, 'has Been Removed From Table - Intro Or AFK.')
					for i = 1, #plrs do
					if plrs[1] == Player then
					table.remove(plrs,i) --Remove Player from table if they are in the intro or AFK.
1 Like

I’m not entirely certain what you mean. Could you explain what you want your code to do?

2 Likes

Im Trying to Check to See if a players AFK Tag is false or true. It Does not remove then from the table but the IntroTag One removes/adds though.

It looks like you might mean to use and and not or. The player can be added to the plrs table if they are AFK but not Intro, and they can also be added if they’re not Intro but they are AFK. If they are one of those then you want to run the second branch in the if statement, but if they’re not one of those then the first branch will run. Switching the order of the two branches would have the same effect.

1 Like

Thank you. That Fixed the Problem

1 Like

Actually it did not. And Does not work.

I’m still slightly confused. Can you tell me if this table is accurate?

Intro AFK Add/remove
true true add
true false remove
false true remove
false false remove

Well. if intro and AFK is true then remove from table.
if Both are false Add to table.

Then I would try this.

local plrs = {}
        	
        	for i, player in pairs (game.Players:GetPlayers()) do
				  if not (player.IntroTag.Value and player.AFK.Value) then 
        			table.insert(plrs,player)--Add each players into plrs table
        			print(player)
        		else
					warn(player, 'has Been Removed From Table - Intro Or AFK.')
					for i = 1, #plrs do
					if plrs[1] == Player then
					table.remove(plrs,i) --Remove Player from table if they are in the intro or AFK.