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 :(
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 :(
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..
You do not put it in server script service. put it in the workspace with a normal script.
I have tried too but the leaderboard is not visible, maybe the datastore is missing ?
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.
1 comment
This is not a request site.