local TimeCheckDelay = 5;
local Lightning = game:GetService("Lighting")
coroutine.resume(coroutine.create(function()
while true do
print(Lightning.ClockTime)
if Lightning.ClockTime <= 17.75 or Lightning.ClockTime >= 6 then
print("123")
else
print("No")
end
task.wait(TimeCheckDelay)
end
end))
Script wont script no at all as if the time is always in range
I don’t work with lighting that much, but I’m pretty sure the time is based on a 24-hour system. You can go into lighting to change “ClockTime” and see at which point in time will the day be night.
As mentioned in the last reply, the time is based on a 24-hour system. You can add more conditions that will satisfy the code you are trying to accomplish.
This will return back to the old problem you have where the code will always be in range. I suggest adding parenthesis to produce the correct boolean. For example
if (condition == true and condition2 == true) or (condition3 == false and condition4 == true) then
-- do code here
end
Parenthesis are like those parenthesis in order of operation in math. Using them will allow the conditions to be checked first. They could also be used to visually see the code better for readability.