I know… 615 lines… not the greatest you will see, but it works though.
How can I lower this script down to a few lines or atleast below 100 lines (if possible) ?
As far as I heard, the longer the script is, the more latency/ping, network recieve lowering and script performance lowering…
I’m still a beginner at Lua but I’m working on learning on how to optimize code based on other developers showing me how to.
while wait(0.05) do
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta12" or v.Name == "Ta13" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta11" or v.Name == "Ta14" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta10" or v.Name == "Ta15" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta9" or v.Name == "Ta16" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta8" or v.Name == "Ta17" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta7" or v.Name == "Ta18" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta6" or v.Name == "Ta19" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta5" or v.Name == "Ta20" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta4" or v.Name == "Ta21" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta3" or v.Name == "Ta22" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta2" or v.Name == "Ta23" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta1" or v.Name == "Ta24" then
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta12" or v.Name == "Ta13" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta11" or v.Name == "Ta14" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta10" or v.Name == "Ta15" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta9" or v.Name == "Ta16" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta8" or v.Name == "Ta17" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta7" or v.Name == "Ta18" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta6" or v.Name == "Ta19" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta5" or v.Name == "Ta20" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta4" or v.Name == "Ta21" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta3" or v.Name == "Ta22" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta2" or v.Name == "Ta23" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
wait(0.01)
for i,v in pairs (game:GetService("Workspace").TaLights:GetChildren()) do
spawn(function()
if v.Name == "Ta1" or v.Name == "Ta24" then
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
end
end)
end
end
From line 309, the _G.EFFECT_DIMMER things start from the buttom.
Basically:
Anything before line 309:
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
Everything after line 309:
v.Head.Beam.SpotLight.Brightness = 10
v.Head.Lens.Transparency = 0
v.Head.Beam.light.Transparency = NumberSequence.new(0)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 7.5
v.Head.Lens.Transparency = .25
v.Head.Beam.light.Transparency = NumberSequence.new(.25)
wait(0.001)
v.Head.Beam.SpotLight.Brightness = 5
v.Head.Lens.Transparency = .5
v.Head.Beam.light.Transparency = NumberSequence.new(.5)
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
wait(0.001)
v.Head.Lens.Transparency = _G.EFFECT_DIMMER
v.Head.Beam.light.Transparency = NumberSequence.new(_G.EFFECT_DIMMER)
v.Head.Beam.SpotLight.Brightness = _G.EFFECT_DIMMER
See the difference?
But yeah, If anyone could tell me how I would optimize this code and lower it down to 100 lines or less, that would be brilliant.