I have a question. I am making a game right now. So far I have made a if kill a player you earn gold. But I want the currency to save when they leave the game and join back in. Please teach me how to add to my kill a player to earn money script. Here is the script
game.Players.PlayerAdded:connect(function(player) local folder = Instance.new("Folder",player) folder.Name = "leaderstats" local currency1 = Instance.new("IntValue",folder) currency1.Name = "Gold" player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() local tag = character.Humanoid:FindFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local stats = tag.Value:WaitForChild("leaderstats") stats["Gold"].Value = stats ["Gold"].Value + 1000000 end end end) end) end)
Also I have made a shop gui so players can buy weapons with the money they earn. But I want the weapons to save when they leave the game and not need to restart getting weapons everytime. How do I add it to the script or however?
Is there a way to just do both problems for saving currency and shop gui at the same time? Or no please help me!!!

1 comment
But does it work and where to i copy the script in