Universal Script 📌
889 Views
328 Executions

universal orbit script

Universal Script 📌
whatssq
whatssqFirst script
7 months 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

orbit

View Raw
local TargetName = "name" 
local Radius = 2               
local Height = 0             
local Speed = 5                
local Smoothness = 1           

local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

local function orbit()
    local targetPlayer = Players:FindFirstChild(TargetName)
    
    if targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
        local targetPart = targetPlayer.Character.HumanoidRootPart
        local angle = tick() * Speed
        
        local x = math.cos(angle) * Radius
        local z = math.sin(angle) * Radius
        
        local targetPos = targetPart.Position + Vector3.new(x, Height, z)
        
        if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
            LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(targetPos, targetPart.Position)
        end
    end
end

local connection
connection = RunService.Heartbeat:Connect(function()
    if not TargetName or TargetName == "" then 
        connection:Disconnect() 
        return 
    end
    orbit()
end)


Comments

1
Log in to join the conversation. Login
FriedRiceIsYummy's profile picture
FriedRiceIsYummy7 months ago

add toggle

1

Tags

More universal scripts

See all
Script hub
176.6k
1.6M
Bumped 9 minutes ago
Key System
Script hub
46.4k
11.5k
Bumped 2 hours ago
Key System
Paid
Script hub
2.5M
798.8k
Bumped 4 hours ago
Key System

Script hub

#9 today

Verified script badgeLumin Hub | #1 | Insta Steal