Put this in a Script inside Workspace.
local players = {}
local time = 2500
for i = 1,2500 do
wait(1)
time = time - 1
end
game.Players.PlayerAdded:connect(function(p)
local gui = p.PlayerGui:WaitForChild("GuiName")
if gui then
local text = gui.TextLabel
if text then
p.CharacterAdded:connect(function(char)
local human = char:WaitForChild("Humanoid")
human.Died:connect(function()
text.Text = "Game Over"
end)
end)
players:insert(p)
end
end
end)
game.Players.PlayerRemoving:connect(function(p)
table.remove(players,p)
end
while true do
for _,v in pairs (players) do
local find = v.PlayerGui:FindFirstChild("GuiName")
if find then
local text = find.TextLabel
if text then
text.Text = tostring(time)
end
end
end
wait()
end
2 comments
Placing important game logic on each and every client is a very bad idea - you will have to make the server handle it.
^ What he said.