Advertisement
Guest User

Teleport Script

a guest
Nov 26th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. for i, v in pairs(game.Workspace:GetChildren()) do
  2.     if string.sub(v.Name, 0, 8) == "Teleport" then -- Name of teleporters
  3.         print(string.sub(v.Name, 0, 14))
  4.         if string.sub(v.Name, 0, 14) ~= "TeleportFinish" then
  5.             local TID = string.sub(v.Name, 9)
  6.             v.Touched:connect(function(hit)
  7.                 local Character = hit.Parent or hit.Parent.Parent
  8.                 local TF = game.Workspace["TeleportFinish"..TID] -- get TeleportFinishB or something like that
  9.                 if Character.Torso ~= nil then
  10.                     Character.Torso.CFrame = CFrame.new(TF.CFrame.X, TF.CFrame.Y+4, TF.CFrame.Z)
  11.                 end
  12.             end)
  13.         end
  14.     end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement