im trying to make a level up system and so far its great and everything works, but the xp and max xp (max xp as the amount of xp you need until you level up.) arent saving! I have other things that save perfectly same with the levels, and also yes i am adding the xp on the server not the client.
Heres the small bit of the code where it saves:
local XP = folder2:FindFirstChild("XP")
datastore:SetAsync(plr.UserId, XP.Value)
local XPmax = folder2:FindFirstChild("XP").max
datastoremax:SetAsync(plr.UserId, XPmax.Value)
local data = {
XP = (...).Value
XPMax = (...).Value
-- etc
}
datastoremax:SetAsync(plr.UserId, data)
data = datastoremax:GetAsync(plr.UserId)
print(data.XP, data.XPMax)