📜  lua teleport - Lua 代码示例

📅  最后修改于: 2022-03-11 14:54:55.406000             🧑  作者: Mango

代码示例1
local debounce = false

script.Parent.Touched:Connect(function (hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)

    if player and not debounce then
        debounce = true

        local char = player.Character
        local rootPart = char:WaitForChild("HumanoidRootPart")

        char:MoveTo(rootPart.Position + Vector3.new(0, 10, 0))

        wait(.5)
        debounce = false
    end
end)