local objects = 
{
	--Maxime
	createObject(14534,-2141.5000000,645.6992200,1204.9000200,0.0000000,0.0000000,0.0000000,42), --object(ab_woozies01,42), (1,42),
	createObject(17564,-2146.0000000,647.0999800,1206.6200000,0.0000000,0.0000000,90.0000000,42), --object(tempdoor_lae2,42), (1,42),
	createObject(1649,-2134.5000000,645.5000000,1206.3410600,0.0000000,0.0000000,0.0000000,42), --object(wglasssmash,42), (2,42),
	createObject(1491,-2138.1999500,645.4000200,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(gen_doorint01,42), (2,42),
	createObject(1649,-2140.3449700,645.5000000,1206.3410600,0.0000000,0.0000000,0.0000000,42), --object(wglasssmash,42), (3,42),
	createObject(1897,-2139.0998500,645.5000000,1208.0000000,0.0000000,90.0000000,0.0000000,42), --object(wheel_support,42), (1,42),
	createObject(1897,-2135.3994100,645.5000000,1208.0000000,0.0000000,90.0000000,0.0000000,42), --object(wheel_support,42), (2,42),
	createObject(1897,-2137.3994100,645.5000000,1208.0000000,0.0000000,90.0000000,0.0000000,42), --object(wheel_support,42), (3,42),
	createObject(1753,-2142.0000000,646.0000000,1205.5000000,0.0000000,0.0000000,180.0000000,42), --object(swank_couch_1,42), (1,42),
	createObject(1753,-2143.9799800,651.4000200,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(swank_couch_1,42), (2,42),
	createObject(2263,-2141.7480500,651.3515600,1207.1510000,0.0000000,0.0000000,0.0000000,42), --object(frame_slim_4,42), (1,42),
	createObject(2811,-2141.0000000,646.0000000,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(gb_romanpot01,42), (1,42),
	createObject(2811,-2145.1999500,646.0000000,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(gb_romanpot01,42), (2,42),
	createObject(2811,-2145.1999500,651.5000000,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(gb_romanpot01,42), (3,42),
	createObject(2811,-2140.8999000,651.4000200,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(gb_romanpot01,42), (4,42),
	createObject(1714,-2135.1999500,648.5999800,1205.5000000,0.0000000,0.0000000,270.0000000,42), --object(kb_swivelchair1,42), (1,42),
	createObject(2610,-2134.6001000,651.5999800,1206.3000500,0.0000000,0.0000000,270.0000000,42), --object(cj_p_fileing2,42), (1,42),
	createObject(2609,-2134.7299800,651.2000100,1206.1999500,0.0000000,0.0000000,270.0000000,42), --object(cj_p_fileing1,42), (1,42),
	createObject(2066,-2134.8999000,646.9000200,1205.5000000,0.0000000,0.0000000,270.0000000,42), --object(cj_m_fileing2,42), (1,42),
	createObject(1722,-2138.0000000,647.7999900,1205.5000000,0.0000000,0.0000000,300.0000000,42), --object(off_chairnu,42), (1,42),
	createObject(1722,-2137.8999000,649.4000200,1205.5000000,0.0000000,0.0000000,225.0000000,42), --object(off_chairnu,42), (2,42),
	createObject(2165,-2136.6001000,648.0999800,1205.5000000,0.0000000,0.0000000,90.0000000,42), --object(med_office_desk_1,42), (1,42),
	createObject(1754,-2145.1999500,650.2999900,1205.5000000,0.0000000,0.0000000,90.0000000,42), --object(swank_single_1,42), (1,42),
	createObject(1754,-2145.1999500,648.5000000,1205.5000000,0.0000000,0.0000000,90.0000000,42), --object(swank_single_1,42), (2,42),
	createObject(2311,-2143.6999500,649.4000200,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(cj_tv_table2,42), (1,42),
	createObject(1742,-2139.5000000,651.9000200,1205.5999800,0.0000000,0.0000000,0.0000000,42), --object(med_bookshelf,42), (1,42),
	createObject(1808,-2137.6001000,651.7000100,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(cj_watercooler2,42), (1,42),
	createObject(1714,-2134.6999500,644.0000000,1205.5000000,0.0000000,0.0000000,330.0000000,42), --object(kb_swivelchair1,42), (2,42),
	createObject(1753,-2139.6999500,642.2999900,1205.5000000,0.0000000,0.0000000,90.0000000,42), --object(swank_couch_1,42), (3,42),
	createObject(2166,-2134.8000500,642.7999900,1205.5000000,0.0000000,0.0000000,90.0000000,42), --object(med_office_desk_2,42), (1,42),
	createObject(1808,-2134.5000000,641.5999800,1205.5000000,0.0000000,0.0000000,270.0000000,42), --object(cj_watercooler2,42), (2,42),
	createObject(2284,-2134.8000500,643.5000000,1207.0000000,0.0000000,0.0000000,270.0000000,42), --object(frame_6,42), (1,42),
	createObject(2275,-2137.6001000,641.7999900,1207.0000000,0.0000000,0.0000000,180.0000000,42), --object(frame_fab_4,42), (1,42),
	createObject(2811,-2139.6001000,641.5000000,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(gb_romanpot01,42), (5,42),
	createObject(2811,-2139.6001000,645.0999800,1205.5000000,0.0000000,0.0000000,0.0000000,42), --object(gb_romanpot01,42), (6,42),
	createObject(2952,-2145.9670400,647.9803500,1205.4191900,0.0000000,0.0000000,0.0000000,42), --object(kmb_gimpdoor,42), (1,42),

}

local col = createColSphere( -2145.615234375, 646.9287109375, 1206.4937744141, 20)

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", col,
	function( element )
		if element == getLocalPlayer( ) then
			addEventHandler( "onClientRender", root, watchChanges )
		end
	end
)
addEventHandler( "onClientColShapeLeave", col,
	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 )
	-- if getElementModel(object) == 10281 then
		-- setObjectScale ( object, 0.60000002384186  )
	-- end
	setElementCollisionsEnabled ( object, true )
end




