Advertisement
BaconhairGamer

Teleport UI / Chaos Shop

Nov 19th, 2022
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. local TeleportUI = Instance.new("ScreenGui")
  2. local BG_1 = Instance.new("Frame")
  3. local UICorner_1 = Instance.new("UICorner")
  4. local Tptext_1 = Instance.new("TextLabel")
  5. local PlayerName_1 = Instance.new("TextBox")
  6. local UICorner_2 = Instance.new("UICorner")
  7. local Submit_1 = Instance.new("TextButton")
  8.  
  9.  
  10. TeleportUI.Name = "TeleportUI"
  11. TeleportUI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  12.  
  13. BG_1.Name = "BG"
  14. BG_1.Parent = TeleportUI
  15. BG_1.BackgroundColor3 = Color3.fromRGB(113,113,113)
  16. BG_1.BorderColor3 = Color3.fromRGB(27,42,53)
  17. BG_1.Position = UDim2.new(0.322751313, 0,0.315533966, 0)
  18. BG_1.Size = UDim2.new(0, 513,0, 296)
  19.  
  20. UICorner_1.Parent = BG_1
  21. UICorner_1.CornerRadius = UDim.new(0,5)
  22.  
  23. Tptext_1.Name = "Tptext"
  24. Tptext_1.Parent = BG_1
  25. Tptext_1.BackgroundColor3 = Color3.fromRGB(255,255,255)
  26. Tptext_1.BackgroundTransparency = 1
  27. Tptext_1.BorderColor3 = Color3.fromRGB(27,42,53)
  28. Tptext_1.Position = UDim2.new(0.30409357, 0,0, 0)
  29. Tptext_1.Size = UDim2.new(0, 200,0, 50)
  30. Tptext_1.Font = Enum.Font.Unknown
  31. Tptext_1.RichText = true
  32. Tptext_1.Text = "Teleport UI"
  33. Tptext_1.TextColor3 = Color3.fromRGB(255,255,255)
  34. Tptext_1.TextScaled = true
  35. Tptext_1.TextSize = 14
  36. Tptext_1.TextWrapped = true
  37.  
  38. PlayerName_1.Name = "PlayerName"
  39. PlayerName_1.Parent = BG_1
  40. PlayerName_1.Active = true
  41. PlayerName_1.BackgroundColor3 = Color3.fromRGB(117,117,117)
  42. PlayerName_1.BackgroundTransparency = 1
  43. PlayerName_1.BorderColor3 = Color3.fromRGB(27,42,53)
  44. PlayerName_1.CursorPosition = -1
  45. PlayerName_1.Position = UDim2.new(0.289175302, 0,0.343184173, 0)
  46. PlayerName_1.Size = UDim2.new(0, 215,0, 105)
  47. PlayerName_1.Font = Enum.Font.SourceSans
  48. PlayerName_1.PlaceholderColor3 = Color3.fromRGB(178,178,178)
  49. PlayerName_1.PlaceholderText = "Player Name"
  50. PlayerName_1.RichText = true
  51. PlayerName_1.Text = ""
  52. PlayerName_1.TextColor3 = Color3.fromRGB(88,88,88)
  53. PlayerName_1.TextScaled = true
  54. PlayerName_1.TextSize = 14
  55. PlayerName_1.TextWrapped = true
  56.  
  57. UICorner_2.Parent = PlayerName_1
  58. UICorner_2.CornerRadius = UDim.new(0,5)
  59.  
  60. Submit_1.Name = "Submit"
  61. Submit_1.Parent = BG_1
  62. Submit_1.Active = true
  63. Submit_1.BackgroundColor3 = Color3.fromRGB(255,255,255)
  64. Submit_1.BackgroundTransparency = 1
  65. Submit_1.BorderColor3 = Color3.fromRGB(27,42,53)
  66. Submit_1.Position = UDim2.new(0.30409357, 0,0.770270288, 0)
  67. Submit_1.Size = UDim2.new(0, 200,0, 50)
  68. Submit_1.Font = Enum.Font.Unknown
  69. Submit_1.RichText = true
  70. Submit_1.Text = "Submit"
  71. Submit_1.TextColor3 = Color3.fromRGB(255,255,255)
  72. Submit_1.TextScaled = true
  73. Submit_1.TextSize = 14
  74. Submit_1.TextWrapped = true
  75.  
  76. local function MdEcmfwxWlqZRlRL()
  77. local script = Instance.new("LocalScript",BG_1)
  78. local UserInputService = game:GetService("UserInputService")
  79. local runService = (game:GetService("RunService"));
  80.  
  81. local gui = script.Parent
  82.  
  83. local dragging
  84. local dragInput
  85. local dragStart
  86. local startPos
  87.  
  88. function Lerp(a, b, m)
  89. return a + (b - a) * m
  90. end;
  91.  
  92. local lastMousePos
  93. local lastGoalPos
  94. local DRAG_SPEED = (8); -- // The speed of the UI darg.
  95. function Update(dt)
  96. if not (startPos) then return end;
  97. if not (dragging) and (lastGoalPos) then
  98. gui.Position = UDim2.new(startPos.X.Scale, Lerp(gui.Position.X.Offset, lastGoalPos.X.Offset, dt * DRAG_SPEED), startPos.Y.Scale, Lerp(gui.Position.Y.Offset, lastGoalPos.Y.Offset, dt * DRAG_SPEED))
  99. return
  100. end;
  101.  
  102. local delta = (lastMousePos - UserInputService:GetMouseLocation())
  103. local xGoal = (startPos.X.Offset - delta.X);
  104. local yGoal = (startPos.Y.Offset - delta.Y);
  105. lastGoalPos = UDim2.new(startPos.X.Scale, xGoal, startPos.Y.Scale, yGoal)
  106. gui.Position = UDim2.new(startPos.X.Scale, Lerp(gui.Position.X.Offset, xGoal, dt * DRAG_SPEED), startPos.Y.Scale, Lerp(gui.Position.Y.Offset, yGoal, dt * DRAG_SPEED))
  107. end;
  108.  
  109. gui.InputBegan:Connect(function(input)
  110. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  111. dragging = true
  112. dragStart = input.Position
  113. startPos = gui.Position
  114. lastMousePos = UserInputService:GetMouseLocation()
  115.  
  116. input.Changed:Connect(function()
  117. if input.UserInputState == Enum.UserInputState.End then
  118. dragging = false
  119. end
  120. end)
  121. end
  122. end)
  123.  
  124. gui.InputChanged:Connect(function(input)
  125. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  126. dragInput = input
  127. end
  128. end)
  129.  
  130. runService.Heartbeat:Connect(Update)
  131. end
  132. coroutine.wrap(MdEcmfwxWlqZRlRL)()
  133.  
  134.  
  135. local function fadgBxZacFPNaddM()
  136. local script = Instance.new("LocalScript",TeleportUI)
  137. local Player = game:GetService("Players").LocalPlayer
  138.  
  139. script.Parent.BG.Submit.MouseButton1Down:Connect(function()
  140. Player.Character.HumanoidRootPart.CFrame = game:GetService("Workspace"):FindFirstChild(script.Parent.BG.PlayerName.Text).HumanoidRootPart.CFrame
  141. end)
  142. end
  143. coroutine.wrap(fadgBxZacFPNaddM)()
  144.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement