SHARE
TWEET

Teleport To Make TeleportPad

a guest Aug 17th, 2019 78 in 304 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. You can delete this ----> BE CAREFUL WIT THIS IF YOU MESS ANYTHING UP IT WILL NOT WORK
  2.  
  3. local Teleport_To_This_Tag = "0001"     -- This is the Tag thing you find in the teleporter bricks. The brick with the tag that matches this is the brick you will tele to once you touch this one.
  4.  
  5. function findTele(tag)
  6.     local tele = nil
  7.     function scan(p)
  8.         for _,v in pairs(p:GetChildren()) do
  9.             if ((v.Name == "Telepad") and (v:findFirstChild("Tag"))) then
  10.             --  if (v.Tag.Value == tag) then tele = v break end
  11.             end
  12.             if (#v:GetChildren() > 0) then scan(v) end
  13.         end
  14.     end
  15.     scan(game:service("Workspace"))
  16.     return tele
  17. end
  18.  
  19. script.Parent.Touched:connect(function(h)
  20.     local p = game:service("Players"):GetPlayerFromCharacter(h.Parent)
  21.     if not (p) then return end
  22.     if (p:findFirstChild("JustTeleported")) then return end
  23.     if not (findTele(Teleport_To_This_Tag)) then return end
  24.     local tele = findTele(Teleport_To_This_Tag)
  25.     if (tele) then
  26.         if (p.Character) then
  27.             p.Character:MoveTo(tele.CFrame.p+Vector3.new(0,3.25,0))
  28.             local t = Instance.new("Weld")
  29.             t.Name = "JustTeleported"
  30.             t.Parent = p
  31.             delay(1.5,function() t:remove() end)
  32.         end
  33.     end
  34. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top