--Checks if the object exceeds the boundries given by the plot----------

local function CheckBoundaries(Plot, Primary)
	local Position = Plot.CFrame
	local Size = CFrame.fromOrientation(0, Primary.Orientation.Y*math.pi/180, 0)*Primary.Size
	local CurrentPos = Position:Inverse()*Primary.CFrame

	local xBound = (Plot.Size.X - Size.X)
	local zBound = (Plot.Size.Z - Size.Z)

	return CurrentPos.X > xBound or CurrentPos.X < -xBound or CurrentPos.Z > zBound or CurrentPos.Z < -zBound
end

local function HandleCollisions(Character, Item, Collisions, Plot)
	if not Collisions then Item.PrimaryPart.Transparency = 1; return true end

	local Collision = CheckHitbox(Character, Item, Plot)
	if Collision then Item:Destroy(); return false end

	Item.PrimaryPart.Transparency = 1
	return true
end
