#Permanent day, constant sun rotation and visibility
1 messages · Page 1 of 1 (latest)
Asks chatgpt I did and it told everything so yeah
add this script to ServerScriptStorage:
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
Lighting.ClockTime = 12 -- inicial hour (08:00 AM)
local speed = 0.02 -- hours per second
RunService.Heartbeat:Connect(function(dt)
Lighting.ClockTime += speed * dt
if Lighting.ClockTime >= 24 then
Lighting.ClockTime -= 24
end
end)
if Lighting.ClockTime >= 18 or Lighting.ClockTime < 6 then
Lighting.FogEnd = 100 -- noite: more fog
else
Lighting.FogEnd = 1000 -- dia: more visible
end
then you can change when the day starts at Lighting.ClockTime , and in local speed you change how much time will take day and night , i use 0.02 , its 10 minutes day , 10 minutes in night
if u want your game to start at 8am you change in Lighting.ClockTime = 8 -- inicial hour (08:00 AM)
But night is still identical to day, right
** You are now Level 1! **
What you mean
Night is darker , day is with Sun
I'm not going for a day/night cycle. I'm trying to make it so it's permanently day, but the sun still rotates and night never happens
Uhh
So it'd be constantly bright, you'd just be looking at the sun move above you during day, then below
I hope I'm being clear with the idea
yea wait a sec
just change for this:
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
-- Start the day at 12 PM (noon)
Lighting.ClockTime = 12
local speed = 0.02 -- hours advanced per second
-- Optional: lock lighting to always appear as day
Lighting.Brightness = 2
Lighting.Ambient = Color3.new(1, 1, 1)
Lighting.OutdoorAmbient = Color3.new(1, 1, 1)
Lighting.FogEnd = 1000
Lighting.GlobalShadows = true
RunService.Heartbeat:Connect(function(dt)
-- Advance time
Lighting.ClockTime += speed * dt
if Lighting.ClockTime >= 24 then
Lighting.ClockTime -= 24
end
-- Keep visual lighting fixed for daylight
Lighting.Brightness = 2
Lighting.Ambient = Color3.new(1, 1, 1)
Lighting.OutdoorAmbient = Color3.new(1, 1, 1)
Lighting.FogEnd = 1000
end)
same thing but always with the day light
i think that works
im using cycle but idk
change the local speed to 1 and see if it works
Night still happens and sun still disappears
Mostly looks like a regular day/night cycle
Strange , try this
Use this script but change it for 0
Oh nevermind sun will not move like that i guess
Im not too good at this sorry
Lua is still a little nightmare for me
Don't worry about it, I appreciate the help. It might just be a roblox limitation where it's impossible to remove night time if you want a cycle
Nah i think theres a lot of games that never have night i guess
For example Tycoons i think they dont have Night
But their sun moves?
It's easy to not have night if you just lock the time to day
Good question