Advertisement
Dev_Galaxy

Teleport Script Roblox

Oct 9th, 2020 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. Part1 Script
  2.  
  3. local Teleport = "Part2" --Put the name of the Part between the ""s.
  4. function Touch(hit) --Indicates that the Part has been Touched.
  5. if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:findFirstChild(Teleport).Locked = true --Checks Debounce.
  6. local Pos = script.Parent.Parent:findFirstChild(Teleport) --Gets the Part to teleport to.
  7. hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end --Takes you there and Ends the Function.
  8. script.Parent.Touched:connect(Touch) --Listens out for Touchers.
  9.  
  10. Part2 Script
  11.  
  12. local Teleport = "Part1" --Put the name of the Part between the ""s.
  13. function Touch(hit) --Indicates that the Part has been Touched.
  14. if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:findFirstChild(Teleport).Locked = true --Checks Debounce.
  15. local Pos = script.Parent.Parent:findFirstChild(Teleport) --Gets the Part to teleport to.
  16. hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end --Takes you there and Ends the Function.
  17. script.Parent.Touched:connect(Touch) --Listens out for Touchers.
  18.  
  19. Please Dont Copy Or Upload This Script Without My Permission
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement