Still have questions? Join our Discord server and get real time help.
0

# How to make leaderboard with IntValues?

I'm trying to make a leaderboard by trying to get the IntValue in each player, but I don't know where to start.

If anyone has any advice, I'd surely appreciate it!

2
RareBIue 133
22 days ago
Edited 22 days ago
local function onPlayerJoin(player)

local Coins = Instance.new("IntValue")
Coins.Name = "Coins"
Coins.Value = 0
end



(EDIT) I forgot to mention that you insert a script inside of serverscriptservice and paste that

another edit! since you wanted your code to coins as a screen gui just put this script inside of a text label

local player = game.Players.LocalPlayer
local coins = stats:WaitForChild("Coins")
local text = script.Parent

text.Text = "Coins:  "..coins.Value
coins("Value"):Connect(function()
text.Text = "Coins:  "..coins.Value
end)


if you have any more questions ask me!

0
Thanks! E TheEggsquidzidBoi 38 — 22d
0
Thanks! W TheEggsquidzidBoi 38 — 22d
0
Thanks! Would you know how to put this as a Screen GUI? (Sorry with the previous comments. My computer screwed up.) TheEggsquidzidBoi 38 — 22d
0
I guess mine didn’t matter iivSnooxy 230 — 22d
0
can you accept my answer @TheEggsquidzidBoi ? RareBIue 133 — 22d
0
Oof mine don’t matter :( iivSnooxy 230 — 21d
0
Can u upvote mine iivSnooxy 230 — 21d
1
iivSnooxy 230
22 days ago

Well I can explain throughly so you can understand...

Let’s start with the function() that will run when the player joins the game

game.Players.PlayerAdded:Connect(function(player)

end)


Now let’s reference the Leaderstats , it should look like this (it is a “Folder” by the way)

game.Players.PlayerAdded:Connect(function(player)
end)


There. , NOW let’s make some money! Won’t be hard don’t worry! Cash will not be a Folder but it’s a IntValue

game.Players.PlayerAdded:Connect(function(player)

Also if you want to change the amount of Cash you have then, change the number of the Value