I don’t really know if this is because of my code or not. Take a look at this video:
Here’s the flicker Module Script:
local module = {}
local TS = game:GetService("TweenService")
function module:flicker(folder, flickers, flickertime, restorepause, restoretime)
for i, object in ipairs(folder:GetChildren()) do
coroutine.wrap(function()
local light = object.SpotLight -- get the spotlight
local baselight = light.Brightness
for i = 1, flickers do -- repeat "flickers" amount of times
light.Brightness = baselight -- set to normal
task.wait(flickertime * math.random(0.85, 1.15))
light.Brightness = 0 -- cut the lights
task.wait(flickertime * math.random(0.85, 1.15))
end
-- note that it ends on a blank light
-- tween system
task.wait(restorepause)
local properties = {Brightness = baselight}
local lightinfo = TweenInfo.new(
restoretime * math.random(0.85, 1.15),
Enum.EasingStyle.Quint,
Enum.EasingDirection.InOut,
0,
false,
0
)
local lighttween = TS:Create(light, lightinfo, properties)
lighttween:Play()
end)()
end
end
return module
Script Call:
local flickerlights = require(game:GetService("ReplicatedStorage").Modules.FlickerLights)
while task.wait(5) do
local folder = game:GetService("Workspace").Lights
flickerlights:flicker(folder, 20, 0.05, 1, 0.5)
end
I doubt that the scripts have anything to do with it, but better safe than sorry. Is this the right place to ask this question? I don’t really know what’s causing this blockiness…
(Also, unrelated but, anyone know how to fix the insane lag when I try and playtest? Massive FPS drop and a bit of unresponsiveness when joining the server. After that it’s completely fine. I had no scripts open, which I know can cause a bit of the playtest lag.)
