# Land Teleport

### 랜드 연결 및 랜드 순서 확인

StartLand (랜드 중 가장 먼저 뜨게 될 랜드)에 ConnectLand (이동할 수 있는 랜드)를 연결해요.

연결한 랜드는 StartLand <-> ConnectLand / ConnectLand <-> ConnectLand 이동이 가능해요.

먼저, '만들기 > 월드관리'  화면으로 이동하여 원하는 월드의 '월드 설정' 버튼을 클릭하세요.

![](/files/XSiMIwBT4ugTjFYGaI2V)

그 후, 'LAND 연결 설정' 을 눌러주세요.

![](/files/wiIhV3yqLRbfStMQXhCM)

LAND 연결 설정 창이 뜨면 이동할 수 있는 랜드를 모두 '연결' 하고 '저장'을 눌러주세요.

![](/files/08nFJGsHUgILJomTOBkS)

랜드가 연결되면 랜드 순서가 Start Land는 0번, Connect Land는 1번부터 차례로 주어져요

랜드 순서는 랜드 이동을 구현할 때 필요하기 때문에 순서를 기억해주세요.

***

### 랜드 이동 구현

캐릭터가 트리거에 닿으면 랜드를 이동시켜요.

먼저, 원하는 위치에 트리커로 사용할 Collider 를 생성해주세요.

![](/files/mq2ZfB2zmlmv5AqdHKpr)

Collider는 캐릭터가 통과할 수 있도록 프로퍼티에서 '콜리전'을 꺼주세요.

![](/files/RKOPjpjf2oaO8B6EaDQN)

Collider를 트리거로 만들어주기 위해 Collider의 자식 객체로 ServerScript를 추가해주세요.

![](/files/MQWCTAKYp6vFl62wbyAI)

생성한 ServerScript에 아래 샘플 코드를 참고하여 \
TeleportToPublicServer(LandID, PlayerIDList) 함수를 추가해주세요.

landOrder는 '랜드 연결 및 랜드 순 확인'을 참고해주세요.

```lua
-- ServerScript
local Trigger = Script.Parent -- 스크립트의 부모를 트리거로 정의해요.

----------- Teleport 함수 정의 -----------
local function Teleport(self, character)
	if character == nil then
		return
	end

	local playerID = character:GetPlayerID() -- 캐릭터의 플레이어 ID를 가져와요.
	local playerList = {} -- 랜드 이동을 시킬 플레이어 리스트를 만들어주세요.
	table.insert(playerList, playerID) -- playerList에 랜드 이동을 시킬 플레이어의 ID를 넣어주세요.

  local landOrder = 1 -- 첫번째 랜드의 순서에요     
	Game:TeleportToPublicServer(landOrder, playerList) 
end

----------- OnBeginOverlapEvent 정의 -----------
Trigger.Collision.OnBeginOverlapEvent:Connect(Teleport)

```

* 랜드 이동을 시켜주는 함수는 'TeleportToPublicServer' 와 'TeleportToPrivateServer'가 있어요.

  TeleportToPublicServer는 여러 인원이 함께 존재하는 랜드로 이동시킬 경우,

  TeleportToPrivateServer는 특정 인원만 존재하는 랜드로 이동시킬 경우 사용해요.

위의 과정이 모두 끝났다면, 플레이 버튼을 누르고 Collider에 닿았을 때 아래와 같은 로그가 뜨는지 확인해주세요. 로그가 뜬다면 TeleportToPublicSever 함수가 동작하고 있는 거에요.

![](/files/A1f6UORCvhDfc4fr6knM)

마지막으로 랜드 이동이 되는지 확인하기 위해 '맵 올리기'로 랜드를 다시 업로드 하고, 플레이어를 실행시켜주세요. (스튜디오에서는 랜드 이동을 확인할 수 없어요.)

![](/files/SXqwNm4M5MnyccP4NDXU)

## 기타 문의 방법&#x20;

![](/files/-MWcP-8TgALiIzpjrebX)

**다른 개발자들과 다양한 정보를 공유하세요. 디토랜드 운영에게 직접 질문할 수도 있습니다.**

### [**디토랜드 디스코드 바로가기👉**](https://discord.gg/7EugJsh4nX)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ditoland-utplus.gitbook.io/ditoland/manual/land-teleport.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
