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

How do I create a Server Age script using this?

I'm trying to work out the Days in a Server Age script. Any ideas?

while true do
 wait()
 local seconds = math.floor(game.Workspace.DistributedGameTime)
 local minutes = math.floor(game.Workspace.DistributedGameTime / 60)
 local hours = math.floor(game.Workspace.DistributedGameTime / 60 / 60)
 local days = math.floor()
 local seconds = seconds - (minutes * 60)
 local minutes = minutes - (hours * 60)
 if hours < 1 then
  if minutes < 1 then
   script.Parent.Text = seconds.."second(s)"
  else
   script.Parent.Text = minutes.." minute(s) "..seconds.." second(s)"
   
if hours <24 then
	
end

 end
 else script.Parent.Text = hours.."hour(s), "..minutes.." minute(s), "..seconds.." second(s)"
 end?

2 answers

✓ Accepted answer
local seconds = 0
while true do
	wait(1)
	seconds = seconds + 1
	local minutes = seconds / 60
	minutes = math.floor(minutes)
	local hours = minutes / 60
	hours = math.floor(hours)
	local days = hours / 24
	days = math.floor(days)
	local daysAsText = tostring(days)
	print("This server has been online for "..daysAsText.." days.")
end

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