local function y(y,u)local l=VipDoor.CFrame.p-Vector3.new(0,VipDoor.Size.Y/2,0)local D=l+VipDoor.CFrame.lookVector*8 local M=l-VipDoor.CFrame.lookVector*8 local t=(D-u.Position).magnitude local o=(M-u.Position).magnitude if t<o then y:MoveTo(M)else y:MoveTo(D)end end
-- Finds out which side the player is on and teleports them to the other
local function TeleportToOtherSide(character, hitPart)
	local bottomOfDoor = VipDoor.CFrame.p - Vector3.new(0, VipDoor.Size.Y / 2, 0)
	local inFrontOfDoor = bottomOfDoor + VipDoor.CFrame.lookVector * 8
	local behindDoor = bottomOfDoor - VipDoor.CFrame.lookVector * 8

	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
