I have a Street Light and I want to make the light turn off and on at a specified time

  1. What do you want to achieve?
    I would like the street lamp (attached below) to turn on at 6:30PM (18:30) and turn off at 7:30AM (7:30)

  2. What is the issue?
    I have no Idea how to script this. I do not major in scripting as I am a builder.

  3. What solutions have you tried so far?
    I’ve searched through DevForum already and I have found resolutions but they are not very specific and become too complex for me to comprehend.

Take a look at Lighting | Roblox Creator Documentation!

Here’s an example:

local Lighting = game:GetService("Lighting")

local function CheckTime()
   if Lighting:GetMinutesAfterMidnight == 1080 then
      print("It's 6pm!")
      -- more stuff with your street light
   end
end
Lighting.Changed:Connect(CheckTime)
1 Like