I'm trying to make a game sorta like cookie clicker, and was wondering, how do you set a text that only the player can see of the players points (Cookies if you like)?
✓ ANSWER ACCEPTED
Keeping play score?
1 answer
✓ Accepted answer
This is Data Persistence. It saves everything on the leaderboard.
function onPlayerEntered(player)
wait()-- Change to wait for player longer.
player:WaitForDataReady()
repeat wait() until player:FindFirstChild("leaderstats")
if player.DataReady then
if player:findFirstChild("leaderstats") then
local score = player.leaderstats:GetChildren()
for i = 1,#score do
local ScoreLoaded = player:LoadNumber(score[i].Name)
wait()
if ScoreLoaded ~= 0 then
score[i].Value = ScoreLoaded
end
end
end
end
end
function onPlayerLeaving(player)
if player:findFirstChild("leaderstats") then
local score = player.leaderstats:GetChildren()
for i = 1,#score do
player:SaveNumber(score[i].Name,score[i].Value)
end
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)
game.Players.PlayerRemoving:connect(onPlayerLeaving)
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
Woops, i wrote my Question wrong.. >.< re read it. Sorry. XD
Ew, data persistence. It's all about Data Store now.
I don't understand the question now
Example: On a cookie clicker game there is a Text that shows your cookies. That's what I'm trying to do. :p
Oh on the screen. Well I am not sure about that