This script is about if you click everywhere you teleport to exactly where you click
1-- Services
2local Players = game:GetService("Players")
3local UserInputService = game:GetService("UserInputService")
4local LocalPlayer = Players.LocalPlayer
5local teleportTarget = nil
6
7-- Create GUI
8local ScreenGui = Instance.new("ScreenGui")
9ScreenGui.Parent = game.CoreGui
10
11local Frame = Instance.new("Frame")
12Frame.Size = UDim2.new(0, 250, 0, 300)
13Frame.Position = UDim2.new(0.5, -125, 0.4, 0)
14Frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
15Frame.BorderSizePixel = 2
16Frame.Parent = ScreenGui
17
18local Title = Instance.new("TextLabel")
19Title.Size = UDim2.new(1, 0, 0, 30)
20Title.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
21Title.Text = "Player Teleport GUI"
22Title.TextColor3 = Color3.fromRGB(255, 255, 255)
23Title.Font = Enum.Font.GothamBold
24Title.TextSize = 14
25Title.Parent = Frame
26
27-- Scrolling list
28local ScrollingFrame = Instance.new("ScrollingFrame")
29ScrollingFrame.Size = UDim2.new(1, -10, 1, -70)
30ScrollingFrame.Position = UDim2.new(0, 5, 0, 35)
31ScrollingFrame.CanvasSize = UDim2.new(0, 0, 5, 0)
32ScrollingFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
33ScrollingFrame.Parent = Frame
34
35local UIListLayout = Instance.new("UIListLayout")
36UIListLayout.Parent = ScrollingFrame
37UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
38
39-- TP Button
40local TPButton = Instance.new("TextButton")
41TPButton.Size = UDim2.new(1, -10, 0, 30)
42TPButton.Position = UDim2.new(0, 5, 1, -35)
43TPButton.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
44TPButton.Text = "Teleport"
45TPButton.TextColor3 = Color3.fromRGB(255, 255, 255)
46TPButton.Font = Enum.Font.GothamBold
47TPButton.TextSize = 14
48TPButton.Parent = Frame
49
50-- Update player list function
51local function updatePlayerList()
52 for _, child in pairs(ScrollingFrame:GetChildren()) do
53 if child:IsA("TextButton") then
54 child:Destroy()
55 end
56 end
57 for _, player in pairs(Players:GetPlayers()) do
58 if player ~= LocalPlayer then
59 local PlayerButton = Instance.new("TextButton")
60 PlayerButton.Size = UDim2.new(1, 0, 0, 25)
61 PlayerButton.Text = player.Name
62 PlayerButton.TextColor3 = Color3.fromRGB(255, 255, 255)
63 PlayerButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
64 PlayerButton.Font = Enum.Font.Gotham
65 PlayerButton.TextSize = 12
66 PlayerButton.Parent = ScrollingFrame
67
68 PlayerButton.MouseButton1Click:Connect(function()
69 teleportTarget = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
70 TPButton.Text = "Teleport to: " .. player.Name
71 end)
72 end
73 end
74end
75
76-- Teleport function
77TPButton.MouseButton1Click:Connect(function()
78 if teleportTarget then
79 LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = teleportTarget.CFrame + Vector3.new(0, 3, 0)
80 end
81end)
82
83-- Update list on player join/leave
84Players.PlayerAdded:Connect(updatePlayerList)
85Players.PlayerRemoving:Connect(updatePlayerList)
86updatePlayerList()
87
88-- Dragging the GUI
89local dragging, dragInput, dragStart, startPos
90Title.InputBegan:Connect(function(input)
91 if input.UserInputType == Enum.UserInputType.MouseButton1 then
92 dragging = true
93 dragStart = input.Position
94 startPos = Frame.Position
95 end
96end)
97
98Title.InputChanged:Connect(function(input)
99 if input.UserInputType == Enum.UserInputType.MouseMovement then
100 dragInput = input
101 end
102end)
103
104UserInputService.InputChanged:Connect(function(input)
105 if input == dragInput and dragging then
106 local delta = input.Position - dragStart
107 Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
108 end
109end)
110
111Title.InputEnded:Connect(function(input)
112 if input.UserInputType == Enum.UserInputType.MouseButton1 then
113 dragging = false
114 end
115end)