Issues With ELS Script

I’m trying to make an ELS System for a vehicle for my game, When the event is fired the BoolValue would change it’s value, but the value doesn’t change at all. Could somebody help me out?

local Parent = script.Parent
local ELS_Event = Parent.ELS_Event
local ELS_Value = Parent.ELS_Enabled
local Lightbar = Parent.Lights

local Front1 = Lightbar.Front1
local Front2 = Lightbar.Front2
local Front3 = Lightbar.Front3
local Front4 = Lightbar.Front4
local Front5 = Lightbar.Front5
local Front6 = Lightbar.Front6

local Back1 = Lightbar.Back1
local Back2 = Lightbar.Back2
local Back3 = Lightbar.Back3
local Back4 = Lightbar.Back4
local Back5 = Lightbar.Back5
local Back6 = Lightbar.Back6

local Left = Lightbar.Left
local Right = Lightbar.Right

ELS_Event.OnServerEvent:Connect(function()
	if ELS_Value.Value == false then
		ELS_Value.Value = true
	elseif ELS_Value.Value == true then
		ELS_Value.Value = false
	end
end)

local function ELS_Enabled()
	Front1.BillboardLight.Amber.Visible = true
	Front1.SurfaceLight.Amber.Visible = true
	--
	Front2.SurfaceLight.Amber.Visible = true
	Front2.BillboardLight.Amber.Visible = true
	--
	Front3.SurfaceLight.Amber.Visible = true
	Front3.BillboardLight.Amber.Visible = true
	--
	Right.SurfaceLight.Amber.Visible = true
	Right.BillboardLight.Amber.Visible = true
	--
	Front4.BillboardLight.Amber.Visible = false
	Front4.SurfaceLight.Amber.Visible = false
	--
	Front5.SurfaceLight.Amber.Visible = false
	Front5.BillboardLight.Amber.Visible = false
	--
	Front6.SurfaceLight.Amber.Visible = false
	Front6.BillboardLight.Amber.Visible = false
	--
	Left.SurfaceLight.Amber.Visible = false
	Left.BillboardLight.Amber.Visible = false
	wait(0.5)
	Front1.BillboardLight.Amber.Visible = false
	Front1.SurfaceLight.Amber.Visible = false
	--
	Front2.SurfaceLight.Amber.Visible = false
	Front2.BillboardLight.Amber.Visible = false
	--
	Front3.SurfaceLight.Amber.Visible = false
	Front3.BillboardLight.Amber.Visible = false
	--
	Right.SurfaceLight.Amber.Visible = false
	Right.BillboardLight.Amber.Visible = false
	--
	Front4.BillboardLight.Amber.Visible = true
	Front4.SurfaceLight.Amber.Visible = true
	--
	Front5.SurfaceLight.Amber.Visible = true
	Front5.BillboardLight.Amber.Visible = true
	--
	Front6.SurfaceLight.Amber.Visible = true
	Front6.BillboardLight.Amber.Visible = true
	--
	Left.SurfaceLight.Amber.Visible = true
	Left.BillboardLight.Amber.Visible = true
end

local function ELS_Disabled()
	Front1.BillboardLight.Amber.Visible = false
	Front1.SurfaceLight.Amber.Visible = false
	--
	Front2.SurfaceLight.Amber.Visible = false
	Front2.BillboardLight.Amber.Visible = false
	--
	Front3.SurfaceLight.Amber.Visible = false
	Front3.BillboardLight.Amber.Visible = false
	--
	Right.SurfaceLight.Amber.Visible = false
	Right.BillboardLight.Amber.Visible = false
	--
	Front4.BillboardLight.Amber.Visible = false
	Front4.SurfaceLight.Amber.Visible = false
	--
	Front5.SurfaceLight.Amber.Visible = false
	Front5.BillboardLight.Amber.Visible = false
	--
	Front6.SurfaceLight.Amber.Visible = false
	Front6.BillboardLight.Amber.Visible = false
	--
	Left.SurfaceLight.Amber.Visible = false
	Left.BillboardLight.Amber.Visible = false
end

ELS_Event.OnServerEvent:Connect(function()
	ELS_Value.Value = not ELS_Value.Value
	if ELS_Value.Value then
		ELS_Enabled()
	else
		ELS_Disabled()
	end
end)

Try removing the first :Connect and see what happens.

You have this starting on line 23

ELS_Event.OnServerEvent:Connect(function()
	if ELS_Value.Value == false then
		ELS_Value.Value = true
	elseif ELS_Value.Value == true then
		ELS_Value.Value = false
	end
end)

Which could be simplified to the snippet below to invert the bool without ifs/elseifs. Using NOT makes it not what it is now, in the case of a bool, if it’s true make it false, if it’s false make it true.

ELS_Event.OnServerEvent:Connect(function()
    ELS_Value.Value = not ELS_Value.Value
end)

But then on line 107 you’ve re-inverting the bool again on the same event.

ELS_Event.OnServerEvent:Connect(function()
	ELS_Value.Value = not ELS_Value.Value
	if ELS_Value.Value then
		ELS_Enabled()
	else
		ELS_Disabled()
	end
end)

Do you want the bool to be re-inverted at this point?

you inverted it twice so it just goes back to what it was before

ELS_Event.OnServerEvent:Connect(function()
	if ELS_Value.Value == false then
		ELS_Value.Value = true
	elseif ELS_Value.Value == true then
		ELS_Value.Value = false
	end
end)

delete this part of the code that inverts the value, so it will only invert one time

Why do you make 2 functions for one remoteevent and each one is reverting the bool value? Like if you do so then its gonna revert twice which basically mean it wont change