The script that controls the lights? If so @Lobestone told me to put the script in Game > StarterPlayer > StarterPlayerScripts, his script makes the client render the flashing, which is probably why the lights all flash at once, but I can’t explain what I mean.
Here’s his script;
local Rand = Random.new()
function setVisibility(v,name,transparency)
for i,v in next,v:GetChildren() do
if v.Name==name and v:IsA("BasePart") then
v.Transparency=transparency
end
end
end
local modules={};
-- modules['part name to visualize']
-- if a model with 'on' and the part name in [ -- ] exists,
modules['FlashingLight']=function(v)
while v.Parent~=nil do
wait(Rand:NextNumber(0.01, 0.1))
if v.on.Value == true then
setVisibility(v,"FlashingLight",0)
--This function will set all items in the model with the name of 'FlashingLight' to the next number.
wait(0.03)
setVisibility(v,"FlashingLight",1)
wait(0.03)
setVisibility(v,"FlashingLight",0)
wait(0.03)
setVisibility(v,"FlashingLight",1)
wait(0.03)
setVisibility(v,"FlashingLight",0)
wait(0.3)
setVisibility(v,"FlashingLight",1)
wait(0.3)
else
setVisibility(v,"FlashingLight",1)
wait(.5) -- better to wait a bit more if it's off.
end
end
end
modules['FlashingLight2']=function(v)
while v.Parent~=nil do
wait(Rand:NextNumber(0.01, 0.1))
if v.on.Value == true then
setVisibility(v,"FlashingLight2",0)
wait(0.08)
setVisibility(v,"FlashingLight2",1)
wait(0.08)
setVisibility(v,"FlashingLight2",0)
wait(0.08)
setVisibility(v,"FlashingLight2",1)
wait(0.08)
setVisibility(v,"FlashingLight2",0)
wait(0.08)
setVisibility(v,"FlashingLight2",1)
wait(0.08)
setVisibility(v,"FlashingLight2",0)
wait(0.08)
setVisibility(v,"FlashingLight2",1)
wait(0.8)
else
setVisibility(v,"FlashingLight2",1)
wait(.5) -- better to wait a bit more if it's off.
end
end
end
local modulesExisting={}
for i,v in next,modules do
modulesExisting[i]=true
-- Helps convert modules into a true/false quick check.
end
function HookLightGroup(model)
local foundModules={}
local foundModNum=0;
for i,item in next,model:GetChildren() do
if modulesExisting[item.Name] then
print("Module for ",item.Name)
foundModules[item.Name]=true;
foundModNum+=1;
end
end
if foundModNum>0 then
for modulename,v in next,foundModules do
print("Running ",modulename)
task.spawn(function()
modules[modulename](model)
end)
end
else
print("No modules found for ",model)
end
end
--Handling of grabbing any folder/model with 'on' boolvalue inside.
for i,v in next,workspace:GetDescendants() do
local x,y=pcall(function()
if v.Name=="on" and v.ClassName=="BoolValue" then
HookLightGroup(v.Parent)
end
end)
if not x then
warn("LocalLight Issue possible, ",y)
end
end
workspace.DescendantAdded:Connect(function(v)
local x,y=pcall(function()
if v.Name=="on" and v.ClassName=="BoolValue" then
HookLightGroup(v.Parent)
end
end)
if not x then
warn("LocalLight Issue possible, ",y)
end
end)
All other scripts I tried/heard were super complicated and also didn’t seem to work at first. One guy mentioned something that probably would’ve worked very well, but I still am learning to script and I’m not supposed to be asking people for scripts. Pretty sure they say you shouldn’t be asking people to write entire scripts for ya.