Oh that’s great now you only need to add a script that opens the gate and putt it in the part where i did say – gate open and then it will work how you wanted it. also after the == the 9 means on what time it’s going to open
local Lighting = game:GetService("Lighting")
local ServerStorage = game:GetService("ServerStorage")
local OPEN_TIME = 7 -- Open the gate past this time
local CLOSE_TIME = 19 -- Close the gate at this time
function ToggleGate()
local Time = Lighting.ClockTime
if Time >= OPEN_TIME and Time < CLOSE_TIME then -- Check if the current time is between OPEN_TIME and CLOSE_TIME
print("Gate open")
local Gate = workspace:FindFirstChild'Gate'
if Gate then
Gate.Parent = ServerStorage -- Put gate back in ServerStorage because gate should be open
end
elseif Time < OPEN_TIME or Time >= CLOSE_TIME then
print("Gate closed")
local Gate = ServerStorage:FindFirstChild'Gate'
if Gate then
Gate.Parent = workspace -- Put gate back into the game because gate should be closed
end
end
end
Lighting:GetPropertyChangedSignal("ClockTime"):Connect(ToggleGate)
local TIME_SPEED = 60 -- 1 min = 1 hour
local START_TIME = 9 -- 9am
local minutesAfterMidnight = START_TIME * 60
local waitTime = 60 / TIME_SPEED
while true do
minutesAfterMidnight = minutesAfterMidnight + 1
Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(waitTime)
end