suppose to save everything in the inventory, and leaderboard stats.. it doesnt save anything..
function load(player) if player.DataReady then if player then wait() local score = player.Folder:GetChildren() for i = 1,#score do local ScoreLoaded = player:LoadNumber(score[i].Name) wait() if ScoreLoaded ~= 0 then score[i].Value = ScoreLoaded else end end ----Load Inventory---- local inventory = player:findFirstChild("Inventory") if inventory then local saved_inv = player:LoadInstance("Invent") if saved_inv then for j,k in pairs(saved_inv:GetChildren()) do k.Parent = inventory end end end end end end function onPlayerEntered(player) local Inventory = Instance.new("Folder") Inventory.Name = "Inventory" Inventory.Parent = player local leaderboard = Instance.new("Folder") leaderboard.Name = "Folder" leaderboard.Parent = player local Beli = Instance.new("IntValue") Beli.Value = 10 Beli.Name = "Beli" Beli.Parent = leaderboard local Trys = Instance.new("IntValue") Trys.Value = 2 Trys.Name = "Trys" Trys.Parent = leaderboard local DF = Instance.new("StringValue") DF.Name = "DF" DF.Parent = leaderboard local GotDF = Instance.new("IntValue") GotDF.Value = 0 GotDF.Name = "GotDF" GotDF.Parent = leaderboard local SetDF = Instance.new("IntValue") SetDF.Value = 0 SetDF.Name = "SetDF" SetDF.Parent = leaderboard local Scene = Instance.new("IntValue") Scene.Value = 1 Scene.Name = "Scene" Scene.Parent = leaderboard player:WaitForDataReady() load(player) wait() end function onPlayerLeaving(player) end game.Players.PlayerAdded:connect(onPlayerEntered) game.Players.PlayerRemoving:connect(onPlayerLeaving)
Try using this line in localscript:
game.Players.LocalPlayer:SaveNumber(string Key, number Value)
Or to load:
game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer:LoadNumber(string Key)