Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

attempt to compare table with number?

Asked by 4 years ago

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

Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
4 years ago
Edited 4 years ago

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
0
Ouch, to think it was because of a typo. Thanks Gashphul 4 — 4y
Ad

Answer this question