wait(1)RunService.RenderStepped:Connect(function()for q,f in pairs(workspace.Map:GetChildren())do local P=workspace.CurrentCamera.CFrame.Position local C=(f:GetPivot()).Position P=Vector3.new(P.X,0,P.Z)C=Vector3.new(C.X,0,C.Z)local m=(P-C).Magnitude m=m-3000 if m<0 then m=0 end m=(m*m)/3000 local z=(CFrame.new(f:GetAttribute("\079\114\105\103\105\110\097\108\080\111\115\105\116\105\111\110")-Vector3.new(0,m/50,0))).Position if not isPositionOnScreen(f:GetAttribute("\079\114\105\103\105\110\097\108\080\111\115\105\116\105\111\110")-Vector3.new(0,m/50,0))then m=100000000 f:PivotTo(CFrame.new(f:GetAttribute("\079\114\105\103\105\110\097\108\080\111\115\105\116\105\111\110")-Vector3.new(0,m/50,0))*(f:GetPivot()).Rotation)elseif isPositionOnScreen(f:GetAttribute("\079\114\105\103\105\110\097\108\080\111\115\105\116\105\111\110")-Vector3.new(0,m/50,0))then f:PivotTo(CFrame.new(f:GetAttribute("\079\114\105\103\105\110\097\108\080\111\115\105\116\105\111\110")-Vector3.new(0,m/50,0))*(f:GetPivot()).Rotation)end end end)
-- update bruv
wait(1)
RunService.RenderStepped:Connect(function()
	for i, v in pairs(workspace.Map:GetChildren()) do
		local CamPos = workspace.CurrentCamera.CFrame.Position
		local vPos = v:GetPivot().Position

		CamPos = Vector3.new(CamPos.X, 0, CamPos.Z)
		vPos = Vector3.new(vPos.X, 0, vPos.Z)
		local dist = (CamPos - vPos).Magnitude

		dist = dist - 3000
		if dist < 0 then
			dist = 0
		end
		dist = dist * dist / 3000
		local currentPos = CFrame.new(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist / 50, 0)).Position
		--[[
	local refinedPosHeight
	if v:isA("BasePart") then
		refinedPosHeight = Vector3.new(0, currentPos.Y + v.Size.Y/2, 0)
	else
		local cframe, size = v:GetBoundingBox()
		refinedPosHeight = Vector3.new(0, currentPos.Y + size.Y/2, 0)
	end

	if refinedPosHeight.Y < CamPos.Y - 200 then
		dist = 1000000
	end
	]]
		if not isPositionOnScreen(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist / 50, 0)) then
			dist = 100000000

			v:PivotTo(
				CFrame.new(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist / 50, 0)) * v:GetPivot().Rotation
			)
		elseif isPositionOnScreen(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist / 50, 0)) then
			v:PivotTo(
				CFrame.new(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist / 50, 0)) * v:GetPivot().Rotation
			)
		end
	end
end)
