Universal Script πŸ“Œ
66.6k Views
139 Executions

Script Verified Universal Orbit Nearest Player Open Source

Universal Script πŸ“Œ
BeboMods
BeboMods
Verified Badge
Verified User
Chart topper
3 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

Literally, Orbit anyone you want when you press V

Updates

  1. Script edited: Create script

View Raw
local players = game:GetService("Players")
local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")

local targetPlayer = nil
local orbitDistance = 5 -- Orbit Distance
local orbitSpeed = 5 -- Orbit Speed ofc dummy don't touch anything else
local orbitToggleKey = Enum.KeyCode.V -- Change V to whatever key bind you like 
local isOrbiting = false

local function getNearestPlayer()
    local nearestDistance = math.huge
    local nearestPlayer = nil

    local localCharacter = players.LocalPlayer.Character
    if localCharacter then
        local localRootPart = localCharacter:FindFirstChild("HumanoidRootPart")
        if localRootPart then
            for _, player in pairs(players:GetPlayers()) do
                if player ~= players.LocalPlayer then
                    local character = player.Character
                    if character and character:FindFirstChild("HumanoidRootPart") then
                        local distance = (character.HumanoidRootPart.Position - localRootPart.Position).Magnitude
                        if distance < nearestDistance then
                            nearestDistance = distance
                            nearestPlayer = player
                        end
                    end
                end
            end
        end
    end

    return nearestPlayer
end

local function startOrbit()
    targetPlayer = getNearestPlayer()
    isOrbiting = true
end


Comments

2
Log in to join the conversation. Login
BeboMods's profile picture
BeboModsVerified
Verified Badge
Verified User
Uploader3 years ago(edited)

press V

1
Guelgamesbr's profile picture
Guelgamesbr3 years ago(edited)

how does it works

1

More universal scripts

See all
Script hub
33.1k
298.1k
Bumped 1 hour ago
Script hub
23.6k
5.2k
Bumped 1 hour ago
Key System
Paid
High QualityΒ Offering
Universal Script πŸ“Œ
195
556
Bumped 2 hours ago
Universal Script πŸ“Œ
1.6k
30.3k
Bumped 2 hours ago
Script hub
4.1M
558.5k
Bumped 2 hours ago
Key System

Script hub

Hall of Fame #3

Verified script badgeOverflow 35 Supported Games

Script hub
5.5k
28.9k
Bumped 3 hours ago
Key System
Script hub
14.0k
28.5k
Bumped 4 hours ago