Advertisement
rewired

Part 1 | ROBLOX | Teleportation Script

Jun 1st, 2018
1,424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. local Teleport = "Part2" --Name should be in the ""s.
  2. function Touch(hit) --Indicates that the part has been touched.
  3.     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.
  4.     local Pos = script.Parent.Parent:findFirstChild(Teleport) --Gets the part to teleport to.
  5.         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.
  6. script.Parent.Touched:connect(Touch) --Listens out for touchers.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement