Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Leaderboard for time played ?

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 :(

1 comment

0

This is not a request site.

2 answers

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)

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

3 comments

0

You do not put it in server script service. put it in the workspace with a normal script.

0

I have tried too but the leaderboard is not visible, maybe the datastore is missing ?

0

NVM my bad. copy and paste the script now and try again ive edited it

This discussion is preserved as it was. New answers, comments, and votes are closed.