Attribute not the same as number?

I made a script that makes a list of guis in order for using UIListLayout.

This script refuses to do the function even though the number and the attribute number are the exact same.

I even printed them and both “i”, and “listnum” print out the same number. I’m just found out about attributes today so can someone explain what’s happening?
image
image

is listnumber a number or string? make sure they’re both numbers

You could use tonumber(listnum)

i made it a number attribute, and im taking the value of the attribute

isnt it already a number? Or is it something else?

Attrbiutes are always strings, If you’ve typed for example 2 in your attribute, As it is a string it will be converted to “2”, so you’ll have to use tonumber(attribute) to convert it to a number

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.