roblox studio check dictionary
xxxxxxxxxx
function same_table(t1, t2)
if typeof(t1) == "table" and typeof(t2) == "table" then
for i,v in pairs(t1) do
if t2[i] then
if not same_table(v, t2[i]) then
return false
end
else
return false
end
end
for i,v in pairs(t2) do
if t1[i] then
if not same_table(v, t1[i]) then
return false
end
else
return false
end
end
return true
else
return t1 == t2
end
end
This is a recursive function which will check wether two dictonaries are the same. This includes both keys and values.