
KeylessUniversal

-- Teleport to Selected Player Script
-- Place this script in a LocalScript within a GUI button or other interface
-- Define variables for player and teleport function
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local TeleportSoundId = "4826619573" -- DBZ teleport sound Roblox ID
-- Function to teleport to a selected player
local function teleportToPlayer(selectedName)
-- Find the target player by partial username or display name
local targetPlayer = nil
local lowerSelectedName = selectedName:lower()
for _, player in ipairs(Players:GetPlayers()) do
if player.Name:lower():find(lowerSelectedName) or player.DisplayName:lower():find(lowerSelectedName) then
targetPlayer = player
break
end
end
if not targetPlayer or not targetPlayer.Character then
warn("Target player not found or has no character.")
return
end
-- Ensure the local player has a character
if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
warn("Local player character is not ready.")
return
end
-- Play teleport sound
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://" .. TeleportSoundId
sound.Parent = LocalPlayer.Character
sound:Play()
-- Get the target player's position
local targetRootPart = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
if targetRootPart then
-- Teleport local player to target player's position
LocalPlayer.Character.HumanoidRootPart.CFrame = targetRootPart.CFrame
print("Teleported to " .. targetPlayer.DisplayName)
else
warn("Target player does not have a HumanoidRootPart.")
end
-- Destroy the sound after it finishes playing
sound.Ended:Connect(function()
sound:Destroy()
end)
end
-- Example GUI setup (replace this with your actual GUI logic)
-- Assuming you have a TextBox to input the player name and a Button to trigger teleportation
local screenGui = Instance.new("ScreenGui", LocalPlayer:WaitForChild("PlayerGui"))
local frame = Instance.new("Frame", screenGui)
frame.Size = UDim2.new(0, 300, 0, 150)
frame.Position = UDim2.new(1, -310, 0, 10) -- Move to top-right corner with padding
frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
frame.BorderSizePixel = 0
frame.BackgroundTransparency = 0.2
-- Add a title label
local titleLabel = Instance.new("TextLabel", frame)
titleLabel.Size = UDim2.new(1, 0, 0.2, 0)
titleLabel.Position = UDim2.new(0, 0, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "MADE BY GRAZ"
titleLabel.Font = Enum.Font.GothamBold
titleLabel.TextSize = 18
titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
titleLabel.TextStrokeTransparency = 0.8
titleLabel.TextScaled = true
-- Add minimize button
local minimizeButton = Instance.new("TextButton", frame)
minimizeButton.Size = UDim2.new(0, 30, 0, 30)
minimizeButton.Position = UDim2.new(1, -35, 0, 5)
minimizeButton.Text = "-"
minimizeButton.Font = Enum.Font.GothamBold
minimizeButton.TextSize = 18
minimizeButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
minimizeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
local isMinimized = false
minimizeButton.MouseButton1Click:Connect(function()
isMinimized = not isMinimized
if isMinimized then
frame.Size = UDim2.new(0, 300, 0, 30) -- Minimize to only show the title
else
frame.Size = UDim2.new(0, 300, 0, 150) -- Restore original size
end
end)
local textBox = Instance.new("TextBox", frame)
textBox.Size = UDim2.new(0.8, 0, 0.3, 0)
textBox.Position = UDim2.new(0.1, 0, 0.3, 0)
textBox.PlaceholderText = "Enter Player Name or Display Name"
textBox.Font = Enum.Font.Gotham
textBox.TextSize = 16
textBox.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
textBox.BorderSizePixel = 0
textBox.TextColor3 = Color3.fromRGB(255, 255, 255)
textBox.PlaceholderColor3 = Color3.fromRGB(200, 200, 200)
textBox.Text = ""
local button = Instance.new("TextButton", frame)
button.Size = UDim2.new(0.8, 0, 0.3, 0)
button.Position = UDim2.new(0.1, 0, 0.65, 0)
button.Text = "Teleport"
button.Font = Enum.Font.GothamBold
button.TextSize = 16
button.BackgroundColor3 = Color3.fromRGB(100, 100, 255)
button.BorderSizePixel = 0
button.TextColor3 = Color3.fromRGB(255, 255, 255)
button.MouseEnter:Connect(function()
button.BackgroundColor3 = Color3.fromRGB(80, 80, 230)
end)
button.MouseLeave:Connect(function()
button.BackgroundColor3 = Color3.fromRGB(100, 100, 255)
end)
-- Connect the button to the teleport function
button.MouseButton1Click:Connect(function()
local playerName = textBox.Text
if playerName and playerName ~= "" then
teleportToPlayer(playerName)
else
warn("Please enter a valid player name or display name.")
end
end)



goofy chatgpt
@Exort I cannot be the only one bro