local function V(V,U)local f=VipDoor.CFrame.p-Vector3.new(0,VipDoor.Size.Y/2,0)local g=f+VipDoor.CFrame.lookVector*3 local E=f-VipDoor.CFrame.lookVector*3 local j=(g-U.Position).magnitude local k=(E-U.Position).magnitude if j<k then V:MoveTo(E)else V:MoveTo(g)end end

local function TeleportToOtherSide(character, hitPart)
	local bottomOfDoor = VipDoor.CFrame.p - Vector3.new(0, VipDoor.Size.Y / 2, 0)
	local inFrontOfDoor = bottomOfDoor + VipDoor.CFrame.lookVector * 3
	local behindDoor = bottomOfDoor - VipDoor.CFrame.lookVector * 3
	
	local distanceToFront = (inFrontOfDoor - hitPart.Position).magnitude
	local distanceToBack = (behindDoor - hitPart.Position).magnitude
	if distanceToFront < distanceToBack then
		character:MoveTo(behindDoor)
	else
		character:MoveTo(inFrontOfDoor)
	end
end
