#Table value with name

1 messages · Page 1 of 1 (latest)

finite elbow
#


for _, child in ipairs(Weapons:GetChildren()) do
        if child:IsA("ValueObject") then
            BpWeapons[child.Name] = {
                Value = child.Value
            }
            print(BpWeapons)
        end
    end
    
    Weapons.ChildAdded:Connect(function()
        for _, child in ipairs(Weapons:GetChildren()) do
            if child:IsA("ValueObject") then
            BpWeapons[child.Name] = {
                Name = child.Name,
                Value = child.Value
            }
            print(BpWeapons)
            end
        end
    end)
#

BpWeapons - table

tight pier
#

im on mobile can you send a screen shot instead

tight pier
#

can I see the error on the output

#

or the prints

finite elbow
#

im dont have error, in my Backpack script i have function without saved weapons added to backpack.
im save backpack values without table, but values in table dont named of weapon value name, and backpack script can't create a frame without weapon, because value in table, which clone to a weapons values folder, dont have a normal name and value is nil

tight pier
#

so it print nil

finite elbow
#

yes

#

and the table value have a name "1"

#

but need to have a weapon name and rarity value

tight pier
#

what weapons is? It is a folder

#

or the weapon itself

finite elbow
#

it is a folder inside a player with values? value need to have a sword name to make a frame in backpack with sword and rarity value

tight pier
#

so it’s a stringvalue

#

and to make it visible on the frame this stringvalue.value has to have the name of the weapon parent

tight pier
#

but it print nil so the script don’t detect the weapon name

#

alr can you do add please : print(child) and send me it please

#

on Weapons.ChildAdded function as well

#

and also can I know what is BpWeapons as well if you can show me the line code

finite elbow
tight pier
#

alr tell me when you added print(child)

#

you might have to ping me if I don’t respond faster

finite elbow
#

i dont know

#

i have a value in weapon folder

#

but it dont print child

tight pier
#

Send a screen shot on where did you put the print

finite elbow
#

oh

unkempt vectorBOT
#

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

finite elbow
#

im got

#

child name is 1

#

wtf

#

how i can fix it

#

wait 1 sec

#

im try again

tight pier
#

just show me your current script

#

I don’t think you put it in the good way

finite elbow
#

ok, i have a datastore with old tabel who have a value 1, if i start the game, this value copy in a weapons folder, and child in wepons folder is 1

#

but if im create new datastore and put print child name in function childadded im dont have a output od this command in console

tight pier
#

what

#

all I’m telling you is to print(child) just after ipairs(Weapons:GetChildren()) do and you send me it

finite elbow
#

im make that

finite elbow
#

you dont see my message or what?

#

what your problem

tacit steeple