this is very confusing, can you send a video of the problem?
Let me explain in more detail.
If you are a new player and nobody else has been in the server, it gives you fresh clean data.
If you are a new player and join a server with other players in it., it wonāt give you fresh data and will give you someone elseās data.
Show how it is setting the value to the datastorekey with setasync. Show the full playerremoving event.
Using table.clone only creates a shallow copy of a table which may be affecting your DataFormat dictionary/table. Try deep copying the table instead.
i think table.clone deep clones the table
Adding onto what @RipPBB_TUD said, what is dataformat function aswell? Can you show that. Heck why are there so many functions, I think scripters are too used to just putting things in functions instead of writing out the actual code in the if statement. I usually prefer writing out the code instead of using functions, but thatās just me.
i just finded this:
local function deepCopy(original)
local copy = {}
for k, v in pairs(original) do
if type(v) == "table" then
v = deepCopy(v)
end
copy[k] = v
end
return copy
end
Yep, thatās the commonly used deep copy function. OP should be using this instead of table.clone
I will try deepCopy instead of clone then.
Haha this worked, thanks so much guys. All of that just to realise that table.clone() is not good enough.
you would make me happy if you mark as solution
have a nice day
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.