-
What do you want to achieve? Keep it simple and clear!
So i’m making leveling system for my FPS game. -
What is the issue? Include screenshots / videos if possible!
By some weird error i get that
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
This datastore code is always worked in every my game and still works, this is first problem like that with it. Do not recommend me other datastore scripts please, this one works perfectly.
Code where error possible happens:
--DS values
...
local success, data = LoadData(player)
sessionData[player.UserId] = success and data or {
Values = {
["Kills"] = 0,
["Deaths"] = 0,
["MVPs"] = 0,
},
LevelStorage = {
["Level"] = 0,
["Exp"] = 0,
["RequiredExp"] = 40
},
InventorySet = {
["Primary"] = {
["Class"] = "AssaultRifles",
["Weapon"] = "AK105"
},
["Secondary"] = {
["Class"] = "Pistols",
["Weapon"] = "Glock 19"
},
["Knife"] = {
["Class"] = "Knifes",
["Weapon"] = "DefaultKnife"
},
}
}
...
--Function
...
function PlayerManager.UpdateLevelValue(player, value, valueAmount)
print(value)
if sessionData[player.UserId]["LevelStorage"][value] then
sessionData[player.UserId]["LevelStorage"][value] = valueAmount
end
end
...
Btw value prints out Exp as it should
![]()