The Development Discussion category is for any and all topics related to development on Roblox, as well as topics related to Roblox developers.
- Topics should contribute something to developers
- Topics should encourage discussion
- Topics should be specific
- Topics should not be for concerns relevant to other categories
For more details on ideal topics to create, please review the category guidelines: https://devforum.roblox.com/t/about-the-development-discussion-category/14
Hello! I believe I have discovered an oddly specific limit to how small of a time interval you can give to the program provided here. This is all run on the server side as I was planning on using lightClock for certain events in my game.
I had noticed this because I was trying to get an even 24 minute day night cycle, which would mean I would need each hour to take one minute. Having a time interval between each event of 1/3600 would mean that 60 frames gives one second, and 60 seconds should give one minute irl, and one hour in game, which it does, I think? I never got to test it because of the limit.
I am wondering what this is, why this limit exists, and potential ways I could reprogram this so I can have a clean 24 minute day night cycle instead of whatever this would result in (despite likely not even being noticeably different to any extent).
Note: If you set the time interval to 1/3598 or smaller this program will stop working at all, it will literally do nothing. Its crazy.
Also if any point in this post is incoherent I apologize, I have been working day and night to try and get my game working nicely, as publishing a game from studio to roblox, a lot of things that work in studio don’t work in roblox, which is really strange, but probably has some solid technical reasons. Its also really easy to fix as it often involves just waiting for certain instances etc either way I am off track. Look at this weird number!
local runService = game:GetService("RunService")
local lighting = game:GetService("Lighting")
--takes one second to do 0.06 clocktime passed
--0 is midnight, 1 is 1 hour after midnight
local function updateTime()
local currentTime = lighting.ClockTime
local timeInterval = 1/3597
local newTime = currentTime + timeInterval
lighting.ClockTime = newTime
if currentTime > 6.45 and currentTime < 6.5 then
currentTime = 6.45
--fire the event that makes all the rocks come back
for i=1, table.maxn(brokenRocks), 1 do
--set health and visibility back
rockHealth(brokenRocks[i])
brokenRocks[i].CanCollide = true
brokenRocks[i].CanTouch = true
brokenRocks[i].CanQuery = true
brokenRocks[i].Transparency = 0
--once loop is done clear rocks
if i >= table.maxn(brokenRocks) then
brokenRocks = {}
end
end
print("restored")
end
end
task.wait(5) -- waits before connecting so game can load
runService.Heartbeat:Connect(updateTime)