function init()
	gate2_3_open = FindShapes("gate2_3_open")
	gate2_3_close = FindShapes("gate2_3_close")
	for i=1,#gate2_3_open do
		SetTag(gate2_3_open[i], "interact", "OPEN")
	end
	for i=1,#gate2_3_close do
		SetTag(gate2_3_close[i], "interact", "CLOSE")
	end
	gate2_3_doorMain = FindJoint("gate2_3_door_main")
	gate2_3_doorInter = FindJoints("gate2_3_door_inter")
	gate2_3_doorMain_min, gate2_3_doorMain_max = GetJointLimits(gate2_3_doorMain)
	gate2_3_doorInter_min, gate2_3_doorInter_max = GetJointLimits(gate2_3_doorInter[3])
	gate2_3_doorMain_ords = 0.5
	gate2_3_doorMain_crds = 0.2
	gate2_3_doorInter_ords = 0.8
	gate2_3_doorInter_crds = 0.6
	SetJointMotor(gate2_3_doorMain, 0)
	for i=1,#gate2_3_doorInter do
		SetJointMotor(gate2_3_doorInter[i], 0)
	end
	gate2_3_wrlt = FindJoints("gate2_3_warning")
	gate2_3_lt = FindLights("gate2_3_wnlt")
	gate2_3_open_lt = FindLights("gate2_3_open_lt")
	gate2_3_close_lt = FindLights("gate2_3_close_lt")
	gate2_3_wrlt_spd = 5
	for i=1,#gate2_3_wrlt do
		SetJointMotor(gate2_3_wrlt[i], 0)
	end
	for i=1,#gate2_3_lt do
		SetLightEnabled(gate2_3_lt[i], false)
	end
	for i=1,#gate2_3_open_lt do
		SetLightEnabled(gate2_3_open_lt[i], false)
	end
	for i=1,#gate2_3_close_lt do
		SetLightEnabled(gate2_3_close_lt[i], false)
	end
end
function tick()
	CallPointPressed = GetBool("level.firealarm.callpoint")
	isFireActive = GetBool("level.firealarm")
	reset = GetBool("level.firealarm_reset")
	FireDoor = GetBool("level.firealarm_door")
	gate2_3_door_stat = GetJointMovement(gate2_3_doorInter[3])
	for i=1,#gate2_3_open do
		if GetPlayerInteractShape() == gate2_3_open[i] and InputPressed("interact") then
			gate2_3_openPressed = true
			gate2_3_closePressed = false
		end
	end
	for i=1,#gate2_3_close do
		if GetPlayerInteractShape() == gate2_3_close[i] and InputPressed("interact") then
			gate2_3_closePressed = true
		end
	end
	if gate2_3_openPressed or CallPointPressed or isFireActive or FireDoor then
		for i=1,#gate2_3_open_lt do
			SetLightEnabled(gate2_3_open_lt[i], true)
		end
		for i=1,#gate2_3_close_lt do
			SetLightEnabled(gate2_3_close_lt[i], false)
		end
		SetJointMotorTarget(gate2_3_doorMain, gate2_3_doorMain_max, -gate2_3_doorMain_ords)
		for i=1,#gate2_3_doorInter do
			SetJointMotorTarget(gate2_3_doorInter[i], gate2_3_doorInter_max, -gate2_3_doorInter_ords)
		end
	end
	if gate2_3_closePressed or reset then
		for i=1,#gate2_3_open_lt do
			SetLightEnabled(gate2_3_open_lt[i], false)
		end
		for i=1,#gate2_3_close_lt do
			SetLightEnabled(gate2_3_close_lt[i], true)
		end
		SetJointMotorTarget(gate2_3_doorMain, gate2_3_doorMain_min, gate2_3_doorMain_crds)
		for i=1,#gate2_3_doorInter do
			SetJointMotorTarget(gate2_3_doorInter[i], gate2_3_doorInter_min, gate2_3_doorInter_crds)
		end
	end
	if gate2_3_door_stat > gate2_3_doorInter_min+2.5 and gate2_3_door_stat < gate2_3_doorInter_max-2.5 then
		for i=1,#gate2_3_wrlt do
			SetJointMotor(gate2_3_wrlt[i], gate2_3_wrlt_spd)
		end
		for i=1,#gate2_3_lt do
			SetLightEnabled(gate2_3_lt[i], true)
		end
	else
		for i=1,#gate2_3_wrlt do
			SetJointMotor(gate2_3_wrlt[i], 0)
		end
		for i=1,#gate2_3_lt do
			SetLightEnabled(gate2_3_lt[i], false)
		end
		for i=1,#gate2_3_open_lt do
			SetLightEnabled(gate2_3_open_lt[i], false)
		end
		for i=1,#gate2_3_close_lt do
			SetLightEnabled(gate2_3_close_lt[i], false)
		end
	end
end