
KeylessUniversal

-- PLAYER SELECT + TELEPORT GUI
-- Put this LocalScript in StarterPlayerScripts
local Players = game:GetService("Players")
local player = Players.LocalPlayer
---------------------------------------------------
-- GUI SETUP
---------------------------------------------------
local gui = Instance.new("ScreenGui")
gui.Name = "PlayerSelectGUI"
gui.ResetOnSpawn = false
gui.Parent = player:WaitForChild("PlayerGui")
-- Dropdown frame
local dropdown = Instance.new("Frame")
dropdown.Size = UDim2.new(0,200,0,40)
dropdown.Position = UDim2.new(0.02,0,0.25,0)
dropdown.BackgroundColor3 = Color3.fromRGB(40,40,40)
dropdown.Parent = gui
local selectedLabel = Instance.new("TextButton")
selectedLabel.Size = UDim2.new(1,0,1,0)
selectedLabel.BackgroundColor3 = Color3.fromRGB(60,60,60)
selectedLabel.TextColor3 = Color3.fromRGB(255,255,255)
selectedLabel.Font = Enum.Font.GothamBold
selectedLabel.TextScaled = true
selectedLabel.Text = "Select Player"
selectedLabel.Parent = dropdown
-- List frame
local listFrame = Instance.new("Frame")
listFrame.Size = UDim2.new(1,0,0,0)
listFrame.Position = UDim2.new(0,0,1,0)
listFrame.BackgroundColor3 = Color3.fromRGB(30,30,30)
listFrame.ClipsDescendants = true
listFrame.Parent = dropdown
local UIList = Instance.new("UIListLayout")
UIList.Parent = listFrame
local expanded = false
local selectedPlayer = nil
---------------------------------------------------
-- POPULATE PLAYER LIST
---------------------------------------------------
local function refreshList()
for _, child in ipairs(listFrame:GetChildren()) do
if child:IsA("TextButton") then child:Destroy() end
end
for _, plr in ipairs(Players:GetPlayers()) do
if plr ~= player then
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(1,0,0,35)
btn.BackgroundColor3 = Color3.fromRGB(70,70,70)
btn.TextColor3 = Color3.fromRGB(255,255,255)
btn.Font = Enum.Font.Gotham
btn.TextScaled = true
btn.Text = plr.Name
btn.Parent = listFrame
btn.MouseButton1Click:Connect(function()
selectedPlayer = plr
selectedLabel.Text = "Selected: " .. plr.Name
expanded = false
listFrame:TweenSize(UDim2.new(1,0,0,0), "Out", "Quad", 0.25)
end)
end
end
end
refreshList()
Players.PlayerAdded:Connect(refreshList)
Players.PlayerRemoving:Connect(refreshList)
---------------------------------------------------
-- EXPAND/COLLAPSE DROPDOWN
---------------------------------------------------
selectedLabel.MouseButton1Click:Connect(function()
expanded = not expanded
if expanded then
local amount = #Players:GetPlayers() * 35
listFrame:TweenSize(UDim2.new(1,0,0,amount), "Out", "Quad", 0.25)
else
listFrame:TweenSize(UDim2.new(1,0,0,0), "Out", "Quad", 0.25)
end
end)
---------------------------------------------------
-- TELEPORT BUTTON
---------------------------------------------------
local tpBtn = Instance.new("TextButton")
tpBtn.Size = UDim2.new(0,200,0,50)
tpBtn.Position = UDim2.new(0.02,0,0.32,0)
tpBtn.BackgroundColor3 = Color3.fromRGB(0,150,150)
tpBtn.TextColor3 = Color3.fromRGB(255,255,255)
tpBtn.Font = Enum.Font.GothamBold
tpBtn.TextScaled = true
tpBtn.Text = "GO TO PLAYER"
tpBtn.Parent = gui
tpBtn.MouseButton1Click:Connect(function()
if not selectedPlayer then return end
local char = player.Character or player.CharacterAdded:Wait()
local targetChar = selectedPlayer.Character
if not targetChar then return end
local hrp = char:FindFirstChild("HumanoidRootPart")
local targetHrp = targetChar:FindFirstChild("HumanoidRootPart")
if hrp and targetHrp then
hrp.CFrame = targetHrp.CFrame + Vector3.new(0,2,0)
end
end)No comments yet for this script.



