#getting memory address when executing

1 messages · Page 1 of 1 (latest)

jovial coral
#

Doing a simple exercise with ChatGPT on tables and nested tables and it executes fine but it also executes the memory address, which is confusing to me as i'm new to scripting and unsure why it's doing that vs just executing the information.

Execution = Left
Script = Right

#

want it to be doing something like:

name: Boxi
level: 10
stats:
health: 100
strength: 50
mana: 20
inventory:
1: Sword
2: Dagger
3: Yo ( or whatever value)

vocal summit
#

I would avoid trying to concatenate a whole table to another string

jovial coral
vocal summit
#

to get the effect youre looking for, i would loop through each element of the table, ex:

if subKey == "inventory" then
  for i, item in pairs(subValue) do
    print(tostring(i)..item)
  end
end
vocal summit
#

not really something you can just turn into a string, you can only print the whole value by itself

jovial coral
#

i see

west furnaceBOT
#

studio** You are now Level 2! **studio

vocal summit
#

or print each item inside of it one at a time

#

like in the code suggestion i provided