local objects =
{
	--Maxime
	createObject ( 18030, 2138.09961, -1625.7998, 391.10001 , 0, 0, 0, 56),
	createObject ( 2774, 2150.71973, -1631.34753, 399.70001 , 0, 0, 0, 56),
	createObject ( 2774, 2150.71289, -1629.7998, 399.70001 , 0, 0, 0, 56),
	createObject ( 2774, 2150.71289, -1628.16309, 399.70001 , 0, 0, 0, 56),
	createObject ( 3051, 2149.36035, -1626.80566, 390.10001, 0, 0, 46.236 , 56),
	createObject ( 3051, 2149.35742, -1628.00366, 390.10001, 0, 0, 46.483 , 56),
	createObject ( 1649, 2144.69922, -1630.19922, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2141, -1630.19995, 390.39999, 0, 0, 0.247, 56),
	createObject ( 1649, 2136.59961, -1630.21582, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2134.3916, -1632.44922, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2134.41016, -1636.80957, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1569, 2134.3999, -1639.30005, 388.72, 0, 0, 180 , 56),
	createObject ( 1649, 2142.7998, -1632.19922, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2142.81934, -1636.5791, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1569, 2140.6001, -1630.19995, 388.70001 , 0, 0, 0, 56),
	createObject ( 1649, 2129.1001, -1630.30005, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2124.69995, -1630.31995, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2120.30005, -1630.33801, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2115.8999, -1630.35999, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2131.33008, -1632.51599, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2131.3501, -1636.90002, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1569, 2131.3999, -1639.30005, 388.72, 0, 0, 359.995 , 56),
	createObject ( 1649, 2134.42993, -1641.19995, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2123.30005, -1632.5, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2123.32007, -1636.90002, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1569, 2123.80005, -1630.30005, 388.70001 , 0, 0, 0, 56),
	createObject ( 1569, 2116.30005, -1630.40002, 388.70001 , 0, 0, 0, 56),
	createObject ( 1649, 2123.3999, -1625.09998, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2123.37988, -1620.69995, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2123.36011, -1616.30005, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2123.34497, -1611.90002, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2121.18237, -1627.32605, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2149.1001, -1630.18005, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1569, 2143.6001, -1630.19995, 388.70001 , 0, 0, 0, 56),
	createObject ( 3051, 2149.35742, -1624.54309, 390.10001, 0, 0, 46.241 , 56),
	createObject ( 3051, 2149.35449, -1623.34705, 390.10001, 0, 0, 46.491 , 56),
	createObject ( 1649, 2116.82007, -1627.34998, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2121.15308, -1620.099, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2116.80005, -1620.12, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1569, 2123.3999, -1625.40002, 388.70001, 0, 0, 269.75 , 56),
	createObject ( 1569, 2123.3999, -1617.09998, 388.70001, 0, 0, 269.747 , 56),
	createObject ( 1649, 2128.6001, -1621, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2132.8999, -1620.98206, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2137.19995, -1620.96301, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2141.6001, -1620.94202, 390.39999, 0, 0, 0.247 , 56),
	createObject ( 1649, 2126.375, -1618.79102, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2126.35693, -1614.40002, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 2774, 2126.3999, -1611.69995, 399.70001 , 0, 0, 0, 56),
	createObject ( 1649, 2143.81396, -1618.71301, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2143.7959, -1614.2998, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 2774, 2143.89941, -1611.76562, 399.70001 , 0, 0, 0, 56),
	createObject ( 1649, 2135, -1618.75415, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1649, 2134.97998, -1614.40002, 390.39999, 0, 0, 90.247 , 56),
	createObject ( 1569, 2127.5, -1621, 388.70001 , 0, 0, 0, 56),
	createObject ( 1569, 2140.8999, -1620.90002, 388.70001 , 0, 0, 0, 56),
	createObject ( 1569, 2124, -1611.80005, 388.70001 , 0, 0, 0, 56),
	createObject ( 1714, 2146.3999, -1635.59998, 388.70001, 0, 0, 173.5 , 56),
	createObject ( 1703, 2146.6001, -1630.80005, 388.70001 , 0, 0, 0, 56),
	createObject ( 2165, 2146.19995, -1634.40002, 388.70001 , 0, 0, 0, 56),
	createObject ( 2166, 2144.30005, -1635.40002, 388.70001 , 0, 0, 0, 56),
	createObject ( 2164, 2146.30005, -1638.90002, 388.70001, 0, 0, 180 , 56),
	createObject ( 2174, 2149.3999, -1636.30005, 388.70001, 0, 0, 270 , 56),
	createObject ( 1720, 2148.69995, -1637.09998, 388.70001, 0, 0, 90 , 56),
	createObject ( 1808, 2144.19995, -1638.30005, 388.70001, 0, 0, 178.25 , 56),
	createObject ( 2166, 2136.30005, -1635.59998, 388.70001 , 0, 0, 0, 56),
	createObject ( 2165, 2138.19995, -1634.59998, 388.70001 , 0, 0, 0, 56),
	createObject ( 1714, 2138.5, -1635.80005, 388.70001, 0, 0, 173.496 , 56),
	createObject ( 2164, 2139.19995, -1638.90002, 388.70001, 0, 0, 179.995 , 56),
	createObject ( 1808, 2137, -1638.30005, 388.70001, 0, 0, 178.248 , 56),
	createObject ( 2174, 2142.30005, -1636.30005, 388.70001, 0, 0, 270 , 56),
	createObject ( 1720, 2141.3999, -1637.09998, 388.70001, 0, 0, 90 , 56),
	createObject ( 1703, 2137.1001, -1631, 388.70001 , 0, 0, 0, 56),
	createObject ( 15038, 2136.19922, -1630.89941, 389.39999 , 0, 0, 0, 56),
	createObject ( 2166, 2124.80005, -1635.59998, 388.70001 , 0, 0, 0, 56),
	createObject ( 2165, 2126.69995, -1634.59998, 388.70001 , 0, 0, 0, 56),
	createObject ( 1703, 2127.3999, -1631, 388.70001 , 0, 0, 0, 56),
	createObject ( 1714, 2127, -1635.69995, 388.70001, 0, 0, 173.496 , 56),
	createObject ( 2164, 2127.3999, -1638.90002, 388.70001, 0, 0, 179.995 , 56),
	createObject ( 1808, 2125.30005, -1638.30005, 388.70001, 0, 0, 178.248 , 56),
	createObject ( 2174, 2130.80005, -1636.19995, 388.70001, 0, 0, 270.25 , 56),
	createObject ( 1720, 2130.1001, -1637, 388.70001, 0, 0, 90 , 56),
	createObject ( 15038, 2126.2998, -1630.89941, 389.39999 , 0, 0, 0, 56),
	createObject ( 2166, 2117.5, -1635.5, 388.70001 , 0, 0, 0, 56),
	createObject ( 2165, 2119.3999, -1634.5, 388.70001 , 0, 0, 0, 56),
	createObject ( 2164, 2119.6001, -1638.90002, 388.70001, 0, 0, 179.995 , 56),
	createObject ( 1808, 2117.6001, -1638.30005, 388.70001, 0, 0, 178.248 , 56),
	createObject ( 2174, 2122.80005, -1636.69995, 388.70001, 0, 0, 270.247 , 56),
	createObject ( 1720, 2122.1001, -1637.40002, 388.70001, 0, 0, 90 , 56),
	createObject ( 1703, 2119.19995, -1631.30005, 388.70001 , 0, 0, 0, 56),
	createObject ( 1714, 2119.5, -1635.80005, 388.70001, 0, 0, 173.496 , 56),
	createObject ( 2166, 2118.69995, -1621.69995, 388.70001, 0, 0, 270 , 56),
	createObject ( 2165, 2119.69995, -1623.59998, 388.70001, 0, 0, 270 , 56),
	createObject ( 1714, 2118.3999, -1624.19995, 388.70001, 0, 0, 93.496 , 56),
	createObject ( 2164, 2116.30005, -1623.80005, 388.70001, 0, 0, 89.995 , 56),
	createObject ( 1808, 2116.5, -1621.80005, 388.70001, 0, 0, 88.248 , 56),
	createObject ( 2174, 2118.3999, -1626.80005, 388.70001, 0, 0, 180.247 , 56),
	createObject ( 1720, 2117.6001, -1626.09998, 388.70001 , 0, 0, 0, 56),
	createObject ( 1703, 2122.6001, -1622.09998, 388.70001, 0, 0, 270 , 56),
	createObject ( 2166, 2118.69995, -1614, 388.70001, 0, 0, 270 , 56),
	createObject ( 2165, 2119.69995, -1615.90002, 388.70001, 0, 0, 270 , 56),
	createObject ( 1714, 2118.5, -1616.40002, 388.70001, 0, 0, 93.494 , 56),
	createObject ( 2164, 2116.30005, -1616, 388.70001, 0, 0, 89.995 , 56),
	createObject ( 1808, 2116.5, -1613.69995, 388.70001, 0, 0, 88.242 , 56),
	createObject ( 2174, 2118.6001, -1619.59998, 388.70001, 0, 0, 180.242 , 56),
	createObject ( 1720, 2117.8999, -1618.80005, 388.70001 , 0, 0, 0, 56),
	createObject ( 2166, 2132.80005, -1615.5, 388.70001, 0, 0, 180 , 56),
	createObject ( 2165, 2130.8999, -1616.5, 388.70001, 0, 0, 180 , 56),
	createObject ( 1714, 2130.30005, -1615.19995, 388.70001, 0, 0, 13.494 , 56),
	createObject ( 2164, 2129.30005, -1612, 388.70001, 0, 0, 359.995 , 56),
	createObject ( 1808, 2131.69995, -1612.30005, 388.70001, 0, 0, 0.242 , 56),
	createObject ( 1703, 2122.6001, -1614, 388.70001, 0, 0, 270 , 56),
	createObject ( 1703, 2132.69995, -1619.90002, 388.70001, 0, 0, 180 , 56),
	createObject ( 2174, 2126.8999, -1615.5, 388.70001, 0, 0, 90.242 , 56),
	createObject ( 1720, 2127.6001, -1614.80005, 388.70001, 0, 0, 270 , 56),
	createObject ( 2166, 2141.3999, -1615.59998, 388.70001, 0, 0, 179.995 , 56),
	createObject ( 2165, 2139.5, -1616.59998, 388.70001, 0, 0, 179.995 , 56),
	createObject ( 1714, 2139, -1615.5, 388.70001, 0, 0, 13.491 , 56),
	createObject ( 2164, 2138.6001, -1611.90002, 388.70001, 0, 0, 359.989 , 56),
	createObject ( 1808, 2140.69995, -1612.09998, 388.70001, 0, 0, 0.242 , 56),
	createObject ( 2174, 2135.5, -1614.80005, 388.70001, 0, 0, 90.236 , 56),
	createObject ( 1720, 2136.19995, -1614.09998, 388.70001, 0, 0, 270 , 56),
	createObject ( 1703, 2139.5, -1620, 388.70001, 0, 0, 179.995 , 56),
	createObject ( 16151, 2148.89941, -1617.39941, 389.10001 , 0, 0, 0, 56),
	createObject ( 1825, 2145.1001, -1619.40002, 388.70001 , 0, 0, 0, 56),
	createObject ( 2257, 2147.24707, -1611.88672, 391.1954 , 0, 0, 0, 56),
	createObject ( 2254, 2133.06055, -1611.97266, 391.10007 , 0, 0, 0, 56),
	createObject ( 2255, 2116.69751, -1625.66016, 390.68777, 0, 0, 90 , 56),
	createObject ( 2256, 2149.88379, -1633.23938, 390.92303, 0, 0, 270 , 56),
	createObject ( 2258, 2119.65918, -1611.87109, 391.05099 , 0, 0, 0, 56),
	createObject ( 2259, 2129.53247, -1638.9281, 390.47659, 0, 0, 180.25 , 56),
	createObject ( 2261, 2140.85278, -1638.89636, 390.43918, 0, 0, 180 , 56),
	createObject ( 2262, 2116.70605, -1634.52783, 390.80997, 0, 0, 90 , 56),
	createObject ( 2186, 2129.78784, -1629.63672, 388.73282, 0, 0, 180 , 56),
	createObject ( 2186, 2135.92749, -1621.62854, 388.73282 , 0, 0, 0, 56),
	createObject ( 2774, 2150.18262, -1628.15332, 381.55795 , 0, 0, 0, 56),
	createObject ( 2774, 2150.19043, -1626.6709, 381.56357 , 0, 0, 0, 56),
	createObject ( 2774, 2150.18335, -1623.19104, 381.5657 , 0, 0, 0, 56),
	createObject ( 2774, 2150.18359, -1624.67664, 381.56754 , 0, 0, 0, 56),
	createObject ( 10781, 1950.41602, -2310.8623, 16.328, 0, 0, 270 , 56),
	createObject ( 8948, 1924.10315, -2339.77637, 14.51163, 0, 179.995, 270.25 , 56),
	createObject ( 8168, 1917.11133, -2335.61719, 14.65546, 0, 0, 106.49 , 56),
	createObject ( 8948, 1900.00781, -2294.41699, 14.52896, 0, 179.995, 179.997 , 56),
	createObject ( 8168, 1915.81445, -2287.50488, 14.70566, 0, 0, 16.496 , 56),
	createObject ( 1622, 1912.13953, -2298.86157, 19.5437, 0, 0, 180 , 56),
	createObject ( 1622, 1928.94043, -2339.26001, 19.36795, 0, 0, 272 , 56),
	createObject ( 3051, 1956.31189, -2314.11255, 14.47745, 0, 0, 136.249 , 56),
	createObject ( 3051, 1957.49768, -2314.1084, 14.47745, 0, 0, 316.241 , 56),
	createObject ( 3051, 1957.51526, -2307.62793, 14.46954, 0, 0, 136.236 , 56),
	createObject ( 3051, 1956.31641, -2307.62695, 14.47416, 0, 0, 136.239 , 56),
	createObject ( 5720, 1884.18677, -2292.93701, 14.79611, 0, 0, 180 , 56),
	createObject ( 5720, 1924.48242, -2355.57007, 15.65472, 0, 0, 270.239 , 56),
	createObject ( 14826, 1942.64465, -2311.06372, 13.858, 0, 0, 90 , 56),
	createObject ( 3440, 2149.55371, -1625.65918, 391.10931 , 0, 0, 0, 56),
	createObject ( 3440, 2142.77856, -1630.03735, 391.10931, 0, 0, 250 , 56),
	createObject ( 3440, 2135.02881, -1630.02881, 391.10931, 0, 0, 249.999 , 56),
	createObject ( 3440, 2131.07495, -1630.02515, 391.10931, 0, 0, 249.999 , 56),
	createObject ( 3440, 2123.34155, -1630.03162, 391.10931, 0, 0, 249.999 , 56),
	createObject ( 3440, 2123.58203, -1620.90698, 391.10931, 0, 0, 171.499 , 56),
	createObject ( 3440, 2131.08301, -1621.14648, 391.10931, 0, 0, 61.496 , 56),
	createObject ( 3440, 2135.03711, -1621.14355, 391.10931, 0, 0, 61.49 , 56),
	createObject ( 3440, 2142.78613, -1621.12012, 391.10931, 0, 0, 61.49 , 56),
	createObject ( 2657, 2149.18018, -1625.9491, 390.18179, 0, 0, 335.5 , 56),
	createObject ( 2656, 2149.19043, -1625.34375, 390.17917, 0, 0, 203 , 56),
	createObject ( 2661, 2132.91699, -1639.27637, 391.60181, 0, 0, 179.995 , 56),
	createObject ( 2886, 1958.39563, -2314.42773, 14.56258 , 0, 0, 0, 56),
	createObject ( 7245, 1935.73926, -2409.86914, 16.05904 , 0, 0, 0, 56),
	createObject ( 10184, 1909.16382, -2406.61182, 18.827 , 0, 0, 0, 56),
	createObject ( 2286, 2137.55688, -1611.87109, 391.37177 , 0, 0, 0, 56),
	createObject ( 8378, 1890.8199, -2401.1609, 22.252, 0, 0, 359.75 ), -- This and the next one cover the hole in the wall
	createObject ( 8378, 1890.829, -2391.104, 22.252, 0, 0, 359.997 ),
}

local col1 = createColCuboid(2114.453125, -1645.826171875, 386.20602416992, 40, 40, 10)
local col2 = createColCuboid(1909.8193359375, -2341.8056640625, 12.51, 93, 60, 8)
local col3 = createColCuboid(1903.80859375, -2433.681640625, 11.9, 71, 54, 10)

local function watchChanges( )
	if getElementDimension( getLocalPlayer( ) ) > 0 and getElementDimension( getLocalPlayer( ) ) ~= getElementDimension( objects[1] ) and getElementInterior( getLocalPlayer( ) ) == getElementInterior( objects[1] ) then
		for key, value in pairs( objects ) do
			setElementDimension( value, getElementDimension( getLocalPlayer( ) ) )
		end
	elseif getElementDimension( getLocalPlayer( ) ) == 0 and getElementDimension( objects[1] ) ~= 65535 then
		for key, value in pairs( objects ) do
			setElementDimension( value, 65535 )
		end
	end
end
addEventHandler( "onClientColShapeHit", col1,
	function( element )
		if element == getLocalPlayer( ) then
			addEventHandler( "onClientRender", root, watchChanges )
		end
	end
)
addEventHandler( "onClientColShapeLeave", col1,
	function( element )
		if element == getLocalPlayer( ) then
			removeEventHandler( "onClientRender", root, watchChanges )
		end
	end
)

addEventHandler( "onClientColShapeHit", col2,
	function( element )
		if element == getLocalPlayer( ) then
			addEventHandler( "onClientRender", root, watchChanges )
		end
	end
)
addEventHandler( "onClientColShapeLeave", col2,
	function( element )
		if element == getLocalPlayer( ) then
			removeEventHandler( "onClientRender", root, watchChanges )
		end
	end
)

addEventHandler( "onClientColShapeHit", col3,
	function( element )
		if element == getLocalPlayer( ) then
			addEventHandler( "onClientRender", root, watchChanges )
		end
	end
)
addEventHandler( "onClientColShapeLeave", col3,
	function( element )
		if element == getLocalPlayer( ) then
			removeEventHandler( "onClientRender", root, watchChanges )
		end
	end
)


-- Put them standby for now.
for key, value in pairs( objects ) do
	setElementDimension( value, 65535 )
end

for index, object in ipairs ( objects ) do
    setElementDoubleSided ( object, true )
	--setElementCollisionsEnabled ( object, true )
end
