I"ve tried every tutorial, I"ve done every little thing I deserve to, but can"t seem to make a money mechanism. I"m trying to make a clicker game based upon the nursery rhyme "piggy on the railway". The concept is that you (the piggy) collect rocks (the currency) by clicking on the bed of a railroad track and also protect against trains, which make you shed every one of your stones. So much, I can not seem to discover any type of method to make a currency leaderboard.
You are watching: How to make a money system in roblox
You deserve to check out the default leaderboards here (https://developer.roblox.com/articles/Leaderboards) but you can of course implement your very own GUI and way of storing values. It"s entirely up to you. gullet 471 — 2y
This is a money leaderboard system that saves (Credit to an AlvinBlox Tutorial.)
I have included some notes around how it functions in the manuscript. (This manuscript need to be in ServerScriptService)
```lualocal DataStoreService = game:GetService("DataStoreService")
neighborhood GameDataStore = DataStoreService:GetDataStore("GameDataStore")
--What happens when the player joins the game.
neighborhood leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
--Creates the Coins leaderstat.
local Coins = Instance.new("IntValue")
Coins.Name = "Coins"
Coins.Parent = leaderstats
-- This is the part of the script that loads the information as soon as the player joins.
local Success, ErrorPost = pcall(function()
data = GameDataStore:GetAsync(player.UserId .. "-Coins")
if Success then
Coins.Value = data
print("Tbelow was an error whilst loading data")
--What happens as soon as the player leaves the game.
See more: Where Did The Term Lukewarm Come From, Lukewarm Definition & Meaning
--This is the part that conserves the information when the player leaves.
local Success, ErrorMessage = pcall (function()
if Success then
print("Player Data Successfully Saved.")
print("There was an error when saving data.")
Tutorial which I recommfinish you follow with yourself: https://www.youtube.com/watch?v=DkYupSBUpes