Getting info about map properties

So i’m working on my first ever script - it should spawn random loot all over the map. And I don’t know how to make script get map properties such as width, length and height.


fpos = Vector(13000, 12000, 2000) --this numbers should be taken from map somehow
spos = Vector(-13000, -12000, 3000)

BigLootAmount = 0
SmallLootAmount = 0
AttachLootAmount = 0

function SpawnLoot(name)

	local x = math.random(fpos.x,spos.x)
	local y = math.random(fpos.y,spos.y)
	local z = math.random(fpos.z,spos.z)
	local LootSpawnPoint = Vector(x, y, 2850)
	local lootdropent = ents.Create(name)
	lootdropent:SetPos(LootSpawnPoint)
	lootdropent:Spawn()
	
end

function LootInitialSpawnProcess()

	timer.Create("BigLS", 280, 0, function ()
		CheckAmount()
		if BigLootAmount < 2 then
			SpawnLoot("loot_big")  --my SENTs
		end
	end)
	timer.Create("SmallLS", 120, 0, function ()
		CheckAmount()
		if SmallLootAmount < 10 then
			SpawnLoot("loot_small")
		end
	end)
	timer.Create("AttachLS", 60, 0, function ()
		CheckAmount()
		if AttachLootAmount < 18 then
			SpawnLoot("loot_attach")
		end
	end)

end

function CheckAmount()

	BigLootAmount = 0
	SmallLootAmount = 0
	AttachLootAmount = 0
	for k, v in pairs(ents.GetAll()) do
		if v:GetClass() == "loot_big" then
			BigLootAmount = BigLootAmount + 1
		elseif v:GetClass() == "loot_small" then
			SmallLootAmount = SmallLootAmount + 1
		elseif v:GetClass() == "loot_attach" then
			AttachLootAmount = AttachLootAmount + 1
		end
	end

end

LootInitialSpawnProcess()

I understand that my code is far from optimised. If you know any way it can get better - feel free to respond and show me my mistakes
Thank you for your attention!