Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TeleportUI = Instance.new("ScreenGui")
- local BG_1 = Instance.new("Frame")
- local UICorner_1 = Instance.new("UICorner")
- local Tptext_1 = Instance.new("TextLabel")
- local PlayerName_1 = Instance.new("TextBox")
- local UICorner_2 = Instance.new("UICorner")
- local Submit_1 = Instance.new("TextButton")
- TeleportUI.Name = "TeleportUI"
- TeleportUI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- BG_1.Name = "BG"
- BG_1.Parent = TeleportUI
- BG_1.BackgroundColor3 = Color3.fromRGB(113,113,113)
- BG_1.BorderColor3 = Color3.fromRGB(27,42,53)
- BG_1.Position = UDim2.new(0.322751313, 0,0.315533966, 0)
- BG_1.Size = UDim2.new(0, 513,0, 296)
- UICorner_1.Parent = BG_1
- UICorner_1.CornerRadius = UDim.new(0,5)
- Tptext_1.Name = "Tptext"
- Tptext_1.Parent = BG_1
- Tptext_1.BackgroundColor3 = Color3.fromRGB(255,255,255)
- Tptext_1.BackgroundTransparency = 1
- Tptext_1.BorderColor3 = Color3.fromRGB(27,42,53)
- Tptext_1.Position = UDim2.new(0.30409357, 0,0, 0)
- Tptext_1.Size = UDim2.new(0, 200,0, 50)
- Tptext_1.Font = Enum.Font.Unknown
- Tptext_1.RichText = true
- Tptext_1.Text = "Teleport UI"
- Tptext_1.TextColor3 = Color3.fromRGB(255,255,255)
- Tptext_1.TextScaled = true
- Tptext_1.TextSize = 14
- Tptext_1.TextWrapped = true
- PlayerName_1.Name = "PlayerName"
- PlayerName_1.Parent = BG_1
- PlayerName_1.Active = true
- PlayerName_1.BackgroundColor3 = Color3.fromRGB(117,117,117)
- PlayerName_1.BackgroundTransparency = 1
- PlayerName_1.BorderColor3 = Color3.fromRGB(27,42,53)
- PlayerName_1.CursorPosition = -1
- PlayerName_1.Position = UDim2.new(0.289175302, 0,0.343184173, 0)
- PlayerName_1.Size = UDim2.new(0, 215,0, 105)
- PlayerName_1.Font = Enum.Font.SourceSans
- PlayerName_1.PlaceholderColor3 = Color3.fromRGB(178,178,178)
- PlayerName_1.PlaceholderText = "Player Name"
- PlayerName_1.RichText = true
- PlayerName_1.Text = ""
- PlayerName_1.TextColor3 = Color3.fromRGB(88,88,88)
- PlayerName_1.TextScaled = true
- PlayerName_1.TextSize = 14
- PlayerName_1.TextWrapped = true
- UICorner_2.Parent = PlayerName_1
- UICorner_2.CornerRadius = UDim.new(0,5)
- Submit_1.Name = "Submit"
- Submit_1.Parent = BG_1
- Submit_1.Active = true
- Submit_1.BackgroundColor3 = Color3.fromRGB(255,255,255)
- Submit_1.BackgroundTransparency = 1
- Submit_1.BorderColor3 = Color3.fromRGB(27,42,53)
- Submit_1.Position = UDim2.new(0.30409357, 0,0.770270288, 0)
- Submit_1.Size = UDim2.new(0, 200,0, 50)
- Submit_1.Font = Enum.Font.Unknown
- Submit_1.RichText = true
- Submit_1.Text = "Submit"
- Submit_1.TextColor3 = Color3.fromRGB(255,255,255)
- Submit_1.TextScaled = true
- Submit_1.TextSize = 14
- Submit_1.TextWrapped = true
- local function MdEcmfwxWlqZRlRL()
- local script = Instance.new("LocalScript",BG_1)
- local UserInputService = game:GetService("UserInputService")
- local runService = (game:GetService("RunService"));
- local gui = script.Parent
- local dragging
- local dragInput
- local dragStart
- local startPos
- function Lerp(a, b, m)
- return a + (b - a) * m
- end;
- local lastMousePos
- local lastGoalPos
- local DRAG_SPEED = (8); -- // The speed of the UI darg.
- function Update(dt)
- if not (startPos) then return end;
- if not (dragging) and (lastGoalPos) then
- 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))
- return
- end;
- local delta = (lastMousePos - UserInputService:GetMouseLocation())
- local xGoal = (startPos.X.Offset - delta.X);
- local yGoal = (startPos.Y.Offset - delta.Y);
- lastGoalPos = UDim2.new(startPos.X.Scale, xGoal, startPos.Y.Scale, yGoal)
- 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))
- end;
- gui.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = gui.Position
- lastMousePos = UserInputService:GetMouseLocation()
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- gui.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- runService.Heartbeat:Connect(Update)
- end
- coroutine.wrap(MdEcmfwxWlqZRlRL)()
- local function fadgBxZacFPNaddM()
- local script = Instance.new("LocalScript",TeleportUI)
- local Player = game:GetService("Players").LocalPlayer
- script.Parent.BG.Submit.MouseButton1Down:Connect(function()
- Player.Character.HumanoidRootPart.CFrame = game:GetService("Workspace"):FindFirstChild(script.Parent.BG.PlayerName.Text).HumanoidRootPart.CFrame
- end)
- end
- coroutine.wrap(fadgBxZacFPNaddM)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement