local function M(M,J)local C=M.CFrame local G=CFrame.fromOrientation(0,(J.Orientation.Y*math.pi)/180,0)*J.Size local W=C:Inverse()*J.CFrame local V=M.Size.X-G.X local j=M.Size.Z-G.Z return W.X>V or W.X<-V or W.Z>j or W.Z<-j end local function J(M,J,C,G)if not C then J.PrimaryPart.Transparency=1 return true end local W=CheckHitbox(M,J,G)if W then J:Destroy()return false end J.PrimaryPart.Transparency=1 return true end

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
