Making a custom leveling system Errors: None Whats wrong: Data is not saving Things to know: FE is turned on. And this is a serverscript
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("CashSaveSystem")
local Lvl = DataStore:GetDataStore("Level")
local XPS = DataStore:GetDataStore("XP")
game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder",player)
leader.Name = "Stats"
local Cash = Instance.new("IntValue",leader)
local XPNeeded = Instance.new("IntValue",leader)
XPNeeded.Name = "XPNeeded"
local Level = Instance.new("NumberValue",leader)
Level.Name = "Level"
Cash.Name = "XP"
Cash.Value = ds:GetAsync(player.UserId) or 0
ds:SetAsync(player.UserId, Cash.Value)
Lvl:SetAsync(player.UserId, Level.Value)
XPS:SetAsync(player.UserId, XPNeeded.Value)
XPNeeded.Value = Cash.Value * 500 *1.75
Cash.Changed:connect(function()
if Cash.Value >= XPNeeded.Value then
Cash.Value = 0
XPNeeded.Value = Cash.Value * 150 * 1.75
Level.Value = Level.Value +1
Lvl:SetAsync(player.UserId, Level.Value)
XPS:SetAsync(player.UserId, XPNeeded.Value)
end
ds:SetAsync(player.UserId, Cash.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
ds:SetAsync(player.UserId, player.Stats.XP.Value)
Lvl:SetAsync(player.UserId, player.Stats.Level.Value)
XPS:SetAsync(player.UserId, player.Stats.XPNeeded.Value)
end)

2 comments
Didn't work
make sure its enabled in Configure Game aswell