Ok. let me first give you a explaination of my question. i have a code. but i want it to be MORE usefull to my game. my game is a apocalypse. its not in public currently. and wont be untill its finished. as for my question
"How do i make it very dark at night?" this means, i want it to get very dark in ambient a night time. heres my code so far.
1 = game:service("Lighting") while true do wait(0.1) 1:SetMinutesAfterMidnight(1:GetMinutesAfterMidnight()+1) end
as you see i this gives it time. but i want to make the code. better. this code probally has to do with ambinent methods. and so on. i just want to do this at night time. comment oranswer if your confused. or have a answer
answer below me :still doesnt make it very dark. i just need to know what to add AFTER that.. in order to make it very pitch black
Hmm, try this (Sorry if this is not related to what you were asking);
local time = game:GetService("Lighting") --I used a string other then '1', because I don't think its valid :P while wait(2)do --Loops every 2 seconds if time.TimeOfDay:sub(1,3) == "18:"then --If Lighting's TimeOfDay is 18: o'clock then repeat wait(1/44) --Repeats waiting this amount of time, exactly 0.022727272727273 seconds (used the Studio for the amount of time) time:SetMinutesAfterMidnight(time:GetMinutesAfterMidnight()+0.032) --The script starts changing the TimeOfDay until time.TimeOfDay:sub(1,3) == "05:" --Will stop at 05: o'clock end --The end for the 'if' statement end --The end for the 'while true do end' loop
Hope this helped!
1 local time = game:GetService("Lighting") --I used a string other then '1', because I don't think its valid :P 2 while wait(2)do --Loops every 2 seconds 3 if time.TimeOfDay:sub(1,3) == "18:"then --If Lighting's TimeOfDay is 18: o'clock then 4 repeat wait(1/44) --Repeats waiting this amount of time, exactly 0.022727272727273 seconds (used the Studio for the amount of time) 5 time:SetMinutesAfterMidnight(time:GetMinutesAfterMidnight()+0.032) --The script starts changing the TimeOfDay 6 until time.TimeOfDay:sub(1,3) == "05:" --Will stop at 05: o'clock 7 end --The end for the 'if' statement 8 end --The end for the 'while true do end' loop
THATS YOUR ANSWER