There is a value named "Level" and its in a folder named "stats" Basically this script is supposed to save the value "Level" Why isn't it working???
wait(2)
local ds = game:GetService("DataStoreService"):GetDataStore("PlayerData")
function PlayerEntered(player)
local stats = player.Backpack:WaitForChild("stats")
level = stats.Level
level.Value = ds:GetAsync("Level_"..player.UserId) or 1200
end
function PlayerLeaving(player)
local stats = player.Backpack:WaitForChild("stats")
level = stats.Level
ds:SetAsync("Level_"..player.UserId, level.Value)
end
game.Players.PlayerAdded:connect(PlayerEntered)
game.Players.PlayerRemoving:connect(PlayerLeaving)
--y it no save?
