hawoody

Click TP

May 5th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- developed by elite_doge, 1,11,2015, 5:18 PM
  2.  
  3. local enableKey = "e" -- what key you need to press to teleport
  4.  
  5. ------------------------------------
  6. -- getting needed locals
  7. local p = game.Players.LocalPlayer
  8. local mouse = p:GetMouse()
  9. local char = p.Character
  10. -- creating gui creation functions
  11. function setProperties(gui,t)
  12. gui.BackgroundColor3 = Color3.new(0,0,0)
  13. gui.BackgroundTransparency = t
  14. gui.BorderSizePixel = 0
  15. end
  16.  
  17. function setText(gui,te)
  18. gui.TextStrokeTransparency = 0
  19. gui.TextStrokeColor3 = Color3.new(255,255,255)
  20. gui.TextColor3 = Color3.new(0,0,0)
  21. gui.Text = te
  22. gui.TextScaled = true
  23. gui.TextXAlignment = Enum.TextXAlignment.Center
  24. end
  25. --- creating gui
  26. local gui = Instance.new("ScreenGui",p.PlayerGui)
  27. gui.Name = "TeleportationInfo"
  28. local f = Instance.new("Frame",gui)
  29. f.Size = UDim2.new(0.2,0,0.4,0)
  30. f.Position = UDim2.new(1,0,0.3,0)
  31. setProperties(f,0.5)
  32. local open = Instance.new("TextButton",gui)
  33. open.Name = "Open"
  34. setProperties(open,0.5)
  35. setText(open,"Tele Help")
  36. open.Size = UDim2.new(0.1,0,0.05,0)
  37. open.Position = UDim2.new(1 - open.Size.X.Scale,0,0.5,0)
  38. local text = Instance.new("TextLabel",f)
  39. text.Name = "Text"
  40. setProperties(text,1)
  41. text.Size = UDim2.new(1,0,0.8,0)
  42. setText(text,"Hold 'e' and click where you want to teleport. Click on this gui to close.")
  43. local name = "elite_doge"
  44. local text2 = text:Clone()
  45. text2.Parent = text.Parent
  46. text2.Size = UDim2.new(1,0,0.2,0)
  47. text2.Position = UDim2.new(0,0,0.8,0)
  48. text2.Name = "Creator"
  49. local isOpen = false
  50. local close = Instance.new("TextButton",f)
  51. close.Name = "Close"
  52. text2.Text = "Developed by " .. name.. ", 1/11/2015"
  53. setProperties(close,1)
  54. close.Visible = false
  55. close.Text = ""
  56. close.Size = UDim2.new(1,0,1,0)
  57. -- creating gui functions
  58. close.MouseButton1Down:connect(function()
  59. if isOpen == true then
  60. f:TweenPosition(UDim2.new(1,0,0.3,0),"InOut","Quad",1,true)
  61. open:TweenPosition(UDim2.new(1 - open.Size.X.Scale,0,0.5,0),"InOut","Quad",1,true)
  62. isOpen = false
  63. close.Visible = false
  64. else
  65. close.Visible = false
  66. open:TweenPosition(UDim2.new(1,0,0.5,0),"InOut","Quad",1,true)
  67. end
  68. end)
  69.  
  70. open.MouseButton1Down:connect(function()
  71. if isOpen == false then
  72. isOpen = true
  73. f:TweenPosition(UDim2.new(1 - f.Size.X.Scale,0,0.3,0),"InOut","Quad",1,true)
  74. open:TweenPosition(UDim2.new(1,0,0.5,0),"InOut","Quad",1,true)
  75. close.Visible = true
  76. end
  77. end)
  78. -- click and keydown functions
  79. local enabled = false
  80.  
  81. mouse.KeyDown:connect(function(key)
  82. key = key:lower()
  83. if key == "e" then
  84. enabled = true
  85. end
  86. end)
  87.  
  88. mouse.KeyUp:connect(function(key)
  89. key = key:lower()
  90. if key == "e" then
  91. enabled = false
  92. end
  93. end)
  94.  
  95. mouse.Button1Down:connect(function()
  96. if char and enabled == true then
  97. char.HumanoidRootPart.CFrame = mouse.Hit + Vector3.new(0,7,0)
  98. end
  99. end)
Add Comment
Please, Sign In to add comment