Roblox Game Creator

로블록스_기초_3주차 (teleport)

타몽쓰 2022. 9. 19.

3주차>

 

🙆‍♂️ 출발지점 → 도착지점 두 개 blockpart 생성하기

(출발지점 이름 Teleport, 도착지점 이름 Destination)

 

🙆‍♂️ 출발지점에 새 script 추가 → 이름 Teleport

 

① teleportPart = script.②

local ③ teleport(otherPart)
	local character = otherPart.Parent
	
	local humanoid = character:FindFirstChildOfClass('Humanoid')
	local destination = game.④.⑤
	
	destination.⑥ = ⑦
	destination.⑧ = ⑨
	destination.⑩ = ⓐ
	
	if humanoid then
		humanoid.RootPart.CFrame = CFrame.new(destination.Position)
	end
end

teleportPart.Touched:Connect(ⓑ)

 

🙆‍♂️ 도전과제>

① Destination의 세가지 속성 Anchored, CanCollide, Transparency 값을 다르게 바꿔보고 실행해보기

② 맵을 꾸며보고, Destination을 toolbox 원하는 모델과 결합한 복합공간으로 바꾸어 플레이어를 순간이동해보기

댓글