How to make the item inside a table only print the last one inserted

Screenshot 2024-09-05 031041
I am using a table to get every single item, and I only want it to print the last item inserted instead of every item in a row

image

note that:
autseletcion is the table
cool is the item

1 Like

Why would you not just print(cool)? You already have that value (whatever it is) as a variableā€¦

Anyways:

local num: number
for i,autoselected in ipairs(autselectcion) do
   num = i -- this will overwrite the "num" variable 1 by 1 until the loop is done!
end
print(num)
2 Likes

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