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 table with number?

So in my code there is a table:

waitsequence = {}

In a bunch of other places, there are conditionals like this:

if waitsequence[1]>=1.75 and waitsequence<=4 then

One I run this, I get the error attempt to compare table with number.

The code puts random numbers into waitsequence and I think it's reading the numbers as a string. I just want to make sure and to get a solution.

1 answer

✓ Accepted answer

WaitSequence is a table. Your second condition, waitsequence<=4 is comparing the table WaitSequence to a number, which errors. Try doing waitsequence[1] <= 4.

upvote if helped ty

1 comment

0

Ouch, to think it was because of a typo. Thanks

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