you need to also pick the text object to match the item uid ... or something that pairs the text to the object you create...
Edited: for example i mostly used local variables on objects... and do lets say item.orderid & text.orderid
if you have a dictionary or array with your item, you can also set that variable, and when u spawn the text object just feed the orderid of the item on the text orderid.
and then when u add a new item in your inventory pick the text that matches orderid with item.orderid
something like bellow code
repeat 5 create item at XY
set item.order id to loopindex
create text at item.X item.y + 10
set text.orderid to loopindex
on click add to array item.atorderid + 1
pick text.object by evaluate text.orderid = array.at(text.orderid) set text to array.valueAt(text.orderid)
the above code might not work properly, but should give you an idea on how to set the text and pick its value, depends on how you declare the orderid or value you pick/pair items to text object and viceversa.