How to make a light system without scripting

I am currently building a map that will later be saved as a model and inserted into an already existing game using admin command, however the owner of the game doesn’t permit scripts existing inside the map model. So is there a way I can make lights go automatically on and off in sync to day/night cycle without using any scripts?

1 Like

I dont really think that is possible, you are suppose to script the desired behavior of an object.

2 Likes

Not possible unfortunately

Asdgjjh

just do this.

local Light = script.Parent
local OffTime = 0.5
local OnTime = 0.5

while task.wait(OffTime) do
     Light.Enabled = true
     task.wait(OnTime)
     Light.Enabled = false
end

or if you want to have multiple lights flash then do something like this.

-- put this in ServerScriptService
local OffTime = 0.5
local OnTime = 0.5

while task.wait(OffTime) do
     for i, light in ipairs(workspace:GetDescendants()) do
          if light:IsA("Light") and light.Name == "FlashyLight" then -- name the lights something like "FlashyLight"
               light.Enabled = true
               task.wait(OnTime)
               light.Enabled = false
          end
     end
end

Insert a module script, for example:

local module = {}

function module.Lights()
   --...
end

return module

Module scripts need to be called from a normal script to run:

local lightsModule = require(<...>.map.LightsModule)
lightsModule.Lights()

So there is nothing harmful that the owner should be worried about, unlike normal scripts that run instantly. Other than this albeit complicated method compared to just simple script, you have no other option.

He said without scripts, which is just not possible.

Since there isn’t an actual solution, let’s talk alternatives. If the game owner is willing to listen to feedback, you could ask so that specifically tagged items get scripted behaviors attached to them when loaded (admittedly, I don’t know if tags persist across models like this). That’s at least what I’d do if I were the owner: would be very cool. Could make something really similar to Hammer I/O.