I want to make a game where if you kill someone with a weapon, you get cash from it,
but I also want your cash to save when you leave the game and rejoin.
I also want to code a leaderboard that shows who has the most cash only. (does not show amount of kills)
I really don't know how to code well. I once spent weeks making a cash system once in the past and failed.
Please if anyone knows any scripting or has any tips on where to start, I need help
(like should I start first on making a script for killing someone and earning cash from it?) (should I create a leaderboard first?)
(Also I sort of know how to make a weapon a player holds, swing at another player and the player dies when their health hits 0 but I kind of forgot how.. I have not touched upon learning how to code in more than a year..)
Please all help appreciated ! thank you for reading
I did not find all you wanted like save or not show kills but I did find cash
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Folder",player) leaderstats.Name = "leaderstats" local cash = Instance.new("IntValue",leaderstats) cash.Name = "Cash" -- name of cash cash.Value = 0 -- how much you wanna start out with local kills = Instance.new("IntValue",leaderstats) kills.Name = "Kills" -- name of kills kills.Value = 0 player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() local CreatorTag = character.Humanoid:FindFirstChild("creator") if CreatorTag and CreatorTag.Value then local stats = CreatorTag.Value:WaitForChild("leaderstats") stats["Cash"].Value = stats["Cash"].Value + 20 -- how much cash to give per kill stats["Kills"].Value = stats["Kills"].Value + 1 -- how much kills you get when you kill one person end end) end) end)