Home / World

world.time() / setTime()

world.time() world.setTime(ticks)

Reads or changes the world time.

Parameters

NameTypeDescription
ticksnumberNew time in ticks (0 is morning, 12000 is sunset).

Returns

world.time() returns the current time in ticks. world.setTime() returns nothing. world.setTime() accepts a number and converts it to a long tick value.

Example

command('morning', { op = true }, function(sender)
  world.setTime(0)
  server.broadcast("Time set to morning.")
  return true
end)

Notes

setTime() changes world time immediately and sends the update to clients. The normal world tick continues after setting the time.