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

Attempt to compare boolean and number..?

Hello. I don't know why, but this simple script is having trouble.

plrAmount = #game.Players:GetChildren()
if not plrAmount >= 8 then
	-- yada yada yada
end

Workspace.Boards.Screen.Leaderboard.Holder.Script:2: attempt to compare number and boolean

2 answers

✓ Accepted answer
plrAmount = #game.Players:GetChildren()
if not (plrAmount >= 8) then
    -- yada yada yada
end

You not need the not in the if statement.

Here are some examples:

x >= y -> x is greater or equal to y.

x <= y -> x is less or equal to y.

x == y -> x is equal to y.

x < y -> x is less than y.

x > y -> x is greater than y.

2 comments

0

That doesnt answer my question, does it?

0

Your question is not constructive. You left .....? at the end, which could mean so many things.

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