Universal Script 📌
3.0k Views
7 Executions

teleport to a random player

Universal Script 📌
axzonenow123
axzonenow123First script
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

teleport to a random person pretty simple long script btw

Updates

  1. Script edited: Create script

View Raw
-- Teleport to another player script

local player = game.Players.LocalPlayer
local userInputService = game:GetService("UserInputService")
local teleportKey = Enum.KeyCode.T -- Key to trigger teleport (T key)
local targetPlayer -- Variable to store the player to teleport to

-- Function to teleport the player to the target player's position
local function teleportToPlayer(targetPlayer)
    if targetPlayer and targetPlayer.Character then
        local targetHumanoidRootPart = targetPlayer.Character:WaitForChild("HumanoidRootPart")
        local teleportPosition = targetHumanoidRootPart.Position
        player.Character:SetPrimaryPartCFrame(CFrame.new(teleportPosition))
    end
end

-- Function to select a target player to teleport to
local function selectTargetPlayer()
    -- Display a list of players in the game and allow selection (optional)
    -- For now, we simply set the target player to the first player other than yourself
    for _, otherPlayer in pairs(game.Players:GetPlayers()) do
        if otherPlayer ~= player then
            targetPlayer = otherPlayer
            break
        end
    end
end

-- Detect when the player presses the teleport key (T)
userInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.UserInputType == Enum.UserInputType.Keyboard then
        if input.KeyCode == teleportKey then
            -- Select target player and teleport to them
            selectTargetPlayer()
            if targetPlayer then
                teleportToPlayer(targetPlayer)
            end
        end
    end


Comments

1
Log in to join the conversation. Login
axzonenow123's profile picture
axzonenow123Uploader2 years ago(edited)

pretty trash LMAO

1

More universal scripts

See all
Universal Script 📌
70.8k
7.8k
Bumped 4 hours ago
Key System
Script hub
5.6M
1.2M
Bumped 4 hours ago
Key System
Script hub
199.2k
2.2M
Bumped 7 hours ago
Key System

Script hub

#22 this week

Verified script badgeAirflow HUB

Script hub
22.5k
4.5k
Bumped 10 hours ago
Key System
Paid
High Quality Offering
Script hub
3.6M
885.3k
Bumped 11 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeFlow Hub | 73 Games | Updated

Script hub
13.6k
25.7k
Bumped 12 hours ago
Script hub
297
703
Approved 12 hours ago
Script hub
2.0M
2.4M
Bumped 12 hours ago
Key System