How to teleport players from 2 points (roblox tutorial)

Опубликовано: 11 Август 2026
на канале: Mizie
183
5

Hope you enjoy this video.

code: (make sure you watch the full video to understand)

local model = script.Parent
local PartA = model.PartA
local PartB = model.PartB

for i,v in pairs(model:GetChildren())do

if v:IsA("Part") then

v.Touched:Connect(function(hit)

if hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") then

local character = hit.Parent
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")

if v.Name == "PartA" then
humanoidRootPart.CFrame = PartB.CFrame * CFrame.new(10,0,0)
elseif v.Name == "PartB" then
humanoidRootPart.CFrame = PartA.CFrame * CFrame.new(10,0,0)
end


end

end)

end
end