Apoya a Time.now: Únete a nuestro Plan Premium ¡para una experiencia sin anuncios! Apóyanos: ¡Hazte Premium sin anuncios!
Desarrollo de juegos Guía

Roblox & Real-World Time

Want to make your Roblox game mimic the real world? Use the `HttpService` in Lua to fetch the current time for a specific timezone and synchronize your game's lighting or events.

LUA
local HttpService = game:GetService("HttpService")

        local function getRealTime()
        	local url = "https://time.now/developer/api/timezone/America/New_York"
	
        	local success, response = pcall(function()
        		return HttpService:GetAsync(url)
        	end)
	
        	if success then
        		local data = HttpService:JSONDecode(response)
        		print("NYC Time: " .. data.datetime)
        		return data
        	else
        		warn("Failed to fetch time")
        	end
        end

        -- Run function
        getRealTime()

¿Por qué usar Time.Now para Desarrollo de juegos?

  • Sync Day/Night cycles
  • Live in-game events
  • Easy JSON decoding
Referencia de la API Ver todas las guías