#Comparing 2 dictionaries

3 messages · Page 1 of 1 (latest)

muted ice
#

Basically, I have 2 dictionaries, one of them is for saved player data, and the other one is for when the player doesn not have any saved data

something like this:

t1 - {
money = 0,
level = 0,
exppoints = 0,
coolstuff = 100
}

t2 = data:GetAsync(key)
> t2 = {money = 0, level = 0, exppoints = 0,}

Basically, I want to compare the 2 tables and add missing elements from t1 to t2. How would I accomplish this? Thanks!

long flume
#

Create a function that takes 2 tables

Iterates over t1
On each iteration, checks if the key can be found in t2
If it’s not there, adds it in

#

@muted ice