#Any ideas on how to update metatables to a newer version?

1 messages · Page 1 of 1 (latest)

robust nova
#

I have meta lets say
{
["g"] = false
}

and then i make a change in original datastore

{
["g"] = true;
["Big"] = true
["Small"] = true
}

i wanna update it in a way that it will keep the old values and grab the new ones along
so the result will be

{
["g"] = false;
["Big"] = true
["Small"] = true
}

limber jungle
#

loop trough your original data, then check if each of those values are in the datastore, if that index does not exsist, add it with the value you want, and if it already exsist then continue.

#

Also please change your indexes in your post in the tables

robust nova
#

im not too familiar with that

limber jungle
robust nova
#

yeah code example

#

i have thoughts rn

#

but im not sure

limber jungle
#

write your toughts and i'll correct it for you

#

in code

robust nova
#

for _,v in pairs(GlobalData) do
if PlayerData[v] == nil or not PlayerData[v] then
PlayerData[v] == v
end
end

#

it still wont work right

#

since its grabbing
true false etc etc

#

instead of ["small"]

limber jungle
#
for index, v in pairs(GlobalData) do
        if PlayerData[index] == nil or not PlayerData[index] then
                  PlayerData[index] == v
        end
end
robust nova
#

i see

limber jungle
#

this should work

#

you need to use the index instead of the value

robust nova
#

yeah i see now

#

ty

#

also how do you uhhh

#

write it in that way in discord

limber jungle
robust nova
#

ahhhh

limber jungle
#

not sure where the ` key is

#

because it depends on keyboard

#

but it is most of the time with ~

robust nova
#

ye

#

i found it