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

How to compare IntValues

I was wondering how to use the '>=' on an IntValue. Here's part of my script...

if not ra.Value >= 3000 or ca.Value >= 3000 then

'ra' and 'ca' are both IntValues. I tried doing it with NumberValues, but it didn't work. Help?

4 comments

1

If it didn't work that would mean ra or ca's values weren't more than or equal to 3,000 when the script got to that point. What you are doing there is correct.

0

According to Roblox Error Monitoring System, it says that I'm attempting to compare a number with a bool

0

Then that means your values are BoolValues, or you had the wrong line number.

0

I'm positive everything is correct

1 answer

✓ Accepted answer

The problem is that ROBLOX thought that you were saying "if (not ra.Value) >= 3000 [...]" To fix it, simply add parenthesis like so:

if not (ra.Value >= 3000) or ca.Value >= 3000 then

end

1 comment

0

Thanks!

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