Advertisement
Woof_bot_3000

Teleport Gui

Nov 20th, 2018
4,070
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. -- Objects
  2.  
  3. local ScreenGui = Instance.new("ScreenGui")
  4. local Frame = Instance.new("Frame")
  5. local Player = Instance.new("TextBox")
  6. local TPplayer = Instance.new("TextButton")
  7. local LoopTP = Instance.new("TextButton")
  8. local TPtool = Instance.new("TextButton")
  9. local TPValue = Instance.new("TextLabel")
  10.  
  11. -- Properties
  12.  
  13. ScreenGui.Parent = game.CoreGui
  14.  
  15. Frame.Parent = ScreenGui
  16. Frame.Active = true
  17. Frame.BackgroundColor3 = Color3.new(0.15, 0.15, 0.15)
  18. Frame.BackgroundTransparency = 0.10000000149012
  19. Frame.BorderColor3 = Color3.new(1, 1, 1)
  20. Frame.Draggable = true
  21. Frame.Position = UDim2.new(0.7, 0, 0.7, 0)
  22. Frame.Selectable = true
  23. Frame.Size = UDim2.new(0, 215, 0, 73)
  24.  
  25. Player.Name = "Player"
  26. Player.Parent = Frame
  27. Player.AnchorPoint = Vector2.new(0.5, 0)
  28. Player.BackgroundColor3 = Color3.new(0.165, 0.165, 0.165)
  29. Player.BorderColor3 = Color3.new(1, 1, 1)
  30. Player.Position = UDim2.new(0.259, 0, 0.07, 0)
  31. Player.Size = UDim2.new(0, 100, -0.00999999978, 30)
  32. Player.Font = Enum.Font.SourceSansBold
  33. Player.Text = "Set Player"
  34. Player.TextColor3 = Color3.new(1, 1, 1)
  35. Player.TextSize = 14
  36.  
  37. TPplayer.Name = "TPplayer"
  38. TPplayer.Parent = Frame
  39. TPplayer.AnchorPoint = Vector2.new(0.5, 0)
  40. TPplayer.BackgroundColor3 = Color3.new(0.165, 0.165, 0.165)
  41. TPplayer.BorderColor3 = Color3.new(1, 1, 1)
  42. TPplayer.Position = UDim2.new(0.259, 0, 0.525, 0)
  43. TPplayer.Size = UDim2.new(0, 100, -0.00999999978, 30)
  44. TPplayer.AutoButtonColor = false
  45. TPplayer.Font = Enum.Font.SourceSansBold
  46. TPplayer.Text = "TP To Player"
  47. TPplayer.TextColor3 = Color3.new(1, 1, 1)
  48. TPplayer.TextSize = 14
  49.  
  50. LoopTP.Name = "LoopTP"
  51. LoopTP.Parent = Frame
  52. LoopTP.AnchorPoint = Vector2.new(0.5, 0)
  53. LoopTP.BackgroundColor3 = Color3.new(0.165, 0.165, 0.165)
  54. LoopTP.BorderColor3 = Color3.new(1, 1, 1)
  55. LoopTP.Position = UDim2.new(0.741, 0, 0.07, 0)
  56. LoopTP.Size = UDim2.new(0, 100, -0.00999999978, 30)
  57. LoopTP.AutoButtonColor = false
  58. LoopTP.Font = Enum.Font.SourceSansBold
  59. LoopTP.Text = "Loop Teleport Off"
  60. LoopTP.TextColor3 = Color3.new(1, 1, 1)
  61. LoopTP.TextSize = 14
  62.  
  63. TPtool.Name = "TPtool"
  64. TPtool.Parent = Frame
  65. TPtool.AnchorPoint = Vector2.new(0.5, 0)
  66. TPtool.BackgroundColor3 = Color3.new(0.165, 0.165, 0.165)
  67. TPtool.BorderColor3 = Color3.new(1, 1, 1)
  68. TPtool.Position = UDim2.new(0.741, 0, 0.525, 0)
  69. TPtool.Size = UDim2.new(0, 100, -0.00999999978, 30)
  70. TPtool.AutoButtonColor = false
  71. TPtool.Font = Enum.Font.SourceSansBold
  72. TPtool.Text = "Teleport Tool"
  73. TPtool.TextColor3 = Color3.new(1, 1, 1)
  74. TPtool.TextSize = 14
  75.  
  76. TPValue.Name = "TPValue"
  77. TPValue.Parent = Frame
  78. TPValue.BackgroundColor3 = Color3.new(0, 0, 0)
  79. TPValue.BackgroundTransparency = 1
  80. TPValue.BorderColor3 = Color3.new(1, 1, 1)
  81. TPValue.BorderSizePixel = 2
  82. TPValue.Position = UDim2.new(1000000000, 0, 1000000000, 0)
  83. TPValue.Size = UDim2.new(0, 10, 0, 10)
  84. TPValue.Font = Enum.Font.Cartoon
  85. TPValue.Visible = false
  86. TPValue.Text = "No Player Selected"
  87. TPValue.TextScaled = false
  88. TPValue.TextSize = 10
  89.  
  90. Player.FocusLost:connect(function()
  91. for i,v in pairs(game.Players:GetChildren()) do
  92. if (string.sub(string.lower(v.Name),1,string.len(Player.Text))) == string.lower(Player.Text) then
  93. print("Selected "..v.Name)
  94. TPValue.Text = v.Name
  95. Player.Text = v.Name
  96. wait(2)
  97. Player.Text = "Set Player"
  98. end
  99. end
  100. end)
  101.  
  102. TPplayer.MouseButton1Down:connect(function()
  103. if TPValue.Text == "No Player Selected" then
  104. print("No Player Selected")
  105. TPplayer.Text = "No Player Selected"
  106. wait(2)
  107. TPplayer.Text = "TP To Player"
  108. else
  109. TPtext = game.CoreGui.ScreenGui.Frame.TPValue.Text
  110. PlayerSelected = game:GetService("Players")[tostring(TPtext)].Character.HumanoidRootPart.CFrame
  111. game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = PlayerSelected
  112. end
  113. end)
  114.  
  115. LoopTP.MouseButton1Down:connect(function()
  116. if LoopTPEnabled == false then
  117. LoopTPEnabled = true
  118. LoopTP.Text = "Loop Teleport On"
  119. elseif TPValue.Text == "No Player Selected" then
  120. print("No Player Selected")
  121. LoopTP.Text = "No Player Selected"
  122. wait(2)
  123. LoopTP.Text = "Loop Teleport Off"
  124. else
  125. LoopTPEnabled = false
  126. LoopTP.Text = "Loop Teleport Off"
  127. end
  128. end)
  129.  
  130. TPtool.MouseButton1Down:connect(function()
  131. bin=Instance.new("HopperBin",game.Players.LocalPlayer.Backpack)
  132. bin.Name = "Teleport"
  133.  
  134. function teleportPlayer(pos)
  135.  
  136. local player = game.Players.LocalPlayer
  137. if player == nil or player.Character == nil then return end
  138.  
  139. local char = player.Character
  140.  
  141. char:MoveTo(pos)
  142.  
  143. end
  144.  
  145.  
  146. enabled = true
  147. function onButton1Down(mouse)
  148. if not enabled then
  149. return
  150. end
  151.  
  152. local player = game.Players.LocalPlayer
  153. if player == nil then return end
  154. local cf = mouse.Hit
  155. teleportPlayer(cf.p)
  156.  
  157. end
  158.  
  159. function onSelected(mouse)
  160. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  161. end
  162.  
  163. bin.Selected:connect(onSelected)
  164. end)
  165.  
  166. game:GetService('RunService').Stepped:connect(function()
  167. if TPValue.Text ~= "No Player Selected" then
  168. if LoopTPEnabled then
  169. TPtext = game.CoreGui.ScreenGui.Frame.TPValue.Text
  170. PlayerSelected = game:GetService("Players")[tostring(TPtext)].Character.HumanoidRootPart.CFrame
  171. game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = PlayerSelected
  172. end
  173. end
  174. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement