Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I create a Server Age script using this?

Asked by 5 years ago

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

Log in to vote
3
Answered by 5 years ago
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
Ad
Log in to vote
0
Answered by 5 years ago

use this model - https://www.roblox.com/library/1740290022/Server-Age

0
I need one that has days on it CarlPlandog 20 — 5y

Answer this question