Advertisement
Joriangames

PLAYER TELEPORTER when TOUCHING PART

Jun 29th, 2023
1,639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. -- PLAYER TELEPORTER by BLOXIANCODE youtube.com/c/BloxianCode
  2. -- Tutorial: https://youtube.com/shorts/uIyMTQNl8hc
  3.  
  4. local tpA = script.Parent.tpA
  5. local tpB = script.Parent.tpB
  6.  
  7. local canTouch = true
  8.  
  9. tpA.Touched:Connect(function(hit)
  10.     if hit.Parent:FindFirstChild("Humanoid") then
  11.         if canTouch == true then
  12.             canTouch = false
  13.             hit.Parent.HumanoidRootPart.CFrame = tpB.CFrame + Vector3.new(0,5,0)
  14.             wait(1)
  15.             canTouch = true
  16.         end
  17.     end
  18. end)
  19.  
  20. tpB.Touched:Connect(function(hit)
  21.     if hit.Parent:FindFirstChild("Humanoid") then
  22.         if canTouch == true then
  23.             canTouch = false
  24.             hit.Parent.HumanoidRootPart.CFrame = tpA.CFrame + Vector3.new(0,5,0)
  25.             wait(1)
  26.             canTouch = true
  27.         end
  28.     end
  29. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement