別ゲームへの移動

パーツに触れたら別のゲームに移動させる方法です。

  1. Workspace に Part を1つ追加します。
  2. Part に Script を追加します。
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local placeId = 移動先のゲーム番号

local function onTouch(otherPart)
    local character = otherPart.Parent
    local humanoid = character:FindFirstChildWhichIsA("Humanoid")
 
    if humanoid and not touched then
        local player = game.Players:GetPlayerFromCharacter(character)
        TeleportService:Teleport(placeId, player)
    end
end
 
script.Parent.Touched:Connect(onTouch)    -- Touched イベントの設定

返信を残す