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

how make a stopwatch for everyone?

print("Community Leaderboard script loaded")

function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local mins = Instance.new("IntValue") mins.Name = "Seconds" mins.Value = 1

mins.Parent = stats

stats.Parent = newPlayer

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

end

game.Players.ChildAdded:connect(onPlayerEntered)

1 answer

I assume with the stopwatch, you want it to start upon someone being in the game.

local Players = game:GetService('Players')

Players.PlayerAdded:Connect(function(Player)
	local leaderstats = Instance.new('Folder')
	leaderstats.Parent = Player
	leaderstats.Name = 'leaderstats'
	local Mins = Instance.new('NumberValue')
	Mins.Name = 'Minutes'
	Mins.Value = 0
	while true do
		wait(60) -- 60 seconds in a minute 
		Mins.Value = Mins.Value + 1
	end -- while true do
end) -- playerAdded

3 comments

0

no no i mean in leadeboard tab in leadeboard my script plays only for me how i can make for all players i need to put it in serverstorage?

0

Ah I see, in that case let me edit this.

0

Try now.

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