Issue with a if statement!

Hello everyone,

So I am scripting this thing were if they have an amount of points something happens. For now I have just put a print but it seems to say that I always pass when even I don’t have enough points. I am not sure on how to make this work and I know that I do not have enough points as I made it print out how much points I have so I know.

Part of the Script:

RemoteLast.OnServerEvent:Connect(function(Player)
	print(Player)
	print(pointcount)
	DropBack5.Visible = false
	host.Visible = false
	noask.Visible = false
	noneabove.Visible = false
	Box1noask.Visible = false
	Box2host.Visible = false
	Box3noneabove.Visible = false
	QuestionFive.Visible = false
	
	if pointcount == 3 or 4 or 5 then
		print("This user has passed and is being ranked!")
	else
		print("This user has failed and will be kicked soon!")
		end
end)

Shows the thing that get’s print out and that I do not have enough points:

image

That is not how or works, a or b evaluates to a if a is truthy, b otherwise. (pointcount == 3) or 4 will either evaluate to one of these: true, 4

In the case that pointcount is not equal to 3 then the expression evaluates to 4. So now you have 4 or 5, which always results in 4 since 4 is truthy like all nunbers.

You meant to say:

if table.find({ 3, 4, 5 }, pointcount) then

end
2 Likes