#How do i set a value in an item inside a table?
1 messages · Page 1 of 1 (latest)
You use :
Not =
I believe
i used it and it doesnt make a difference
you have any idea on whats wrong?
Number value can't be nil
So you can prob just save it
Without default of 0
What exactly r u trying
Am confhsed
are you trying to have default values like
when someone joins for first time
their save is that?
yes
mb im not very experienced
** You are now Level 3! **
just put 0,0
and read based on index
so data[1] would be cash
data[2] would be trash collected
unless u want string keys
you can do {"coins": 0,"Trash":0}
i forgot if its : or =
too much python
are there any way to set them in order of how i want them to be? like if i want cash to be data[2] instead
i need knowwwledge im sorry for asking too much questions
ok so
did u work with tables?
{}
i know how tables work
so all youre doing is saving table
and accessing certain index for value
am saying u should just do {} with values u want saved
in whatever order
just make sure u know the order (and preferably dont change, unless at last index)
bc the order will be the order u access the stuff
if you do {gems,coins}
then to read coins u would do data[2]
for gems u would do data[1]
u can use string keys like this
to make it just be
data["coins"]
for value