#How do i set a value in an item inside a table?

1 messages · Page 1 of 1 (latest)

bold verge
#

Im working on a data store and i need to set a default value of 0 to two item, how do i fix this?

bold verge
#

i used it and it doesnt make a difference

south tinsel
#

Wait

#

That's broken logic

#

Mb

#

Well

bold verge
#

you have any idea on whats wrong?

south tinsel
#

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

bold verge
south tinsel
#

their save is that?

bold verge
#

yes

south tinsel
#

well

#

thats defo not how to do it

#

youre basically trying to save

#

Number = 0

bold verge
#

mb im not very experienced

lost ledgeBOT
#

studio** You are now Level 3! **studio

south tinsel
#

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

bold verge
#

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

south tinsel
#

did u work with tables?

#

{}

bold verge
#

i know how tables work

south tinsel
#

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]

south tinsel
#

to make it just be

#

data["coins"]

#

for value