Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Leaderboard for time played ? [closed]

Asked by 5 years ago

I want to make a leaderboard for time played in my server, i have take the model of this script but he doesn't save the leaderboard stats.. you have a script for time playing with save ?

sorry for my bad english :(

0
This is not a request site. mixgingengerina10 223 — 5y

Closed as Not Constructive by User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
function onPlayerEntered(Player)

    local stats = Instance.new("IntValue")
    stats.Name = "leaderstats"

    local mins = Instance.new("IntValue")
    mins.Name = "Time Played"
    mins.Value = 0


    mins.Parent = stats

    stats.Parent = Player

    while true do
        mins.Value = mins.Value + 1
        wait(60)
    end
end

game.Players.ChildAdded:connect(onPlayerEntered)

OR

for time played in seconds

function onPlayerEntered(Player)

    local stats = Instance.new("IntValue")
    stats.Name = "leaderstats"

    local secs = Instance.new("IntValue")
    secs.Name = "Time Played"
    secs.Value = 0


    secs.Parent = stats

    stats.Parent = Player

    while true do
        secs.Value = secs.Value + 1
        wait(1)
    end
end

game.Players.ChildAdded:connect(onPlayerEntered)
Ad
Log in to vote
0
Answered by 5 years ago

Thanks but is not work :/ i don't see my leaderboard, i have put this script in serverscriptservice but don't working..

0
You do not put it in server script service. put it in the workspace with a normal script. LordOfWatermelons 27 — 5y
0
I have tried too but the leaderboard is not visible, maybe the datastore is missing ? Thorngard 4 — 5y
0
NVM my bad. copy and paste the script now and try again ive edited it LordOfWatermelons 27 — 5y