-- Orbitation Controller V1 local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UIS = game:GetService("UserInputService") local player = Players.LocalPlayer -- CONFIGURAÇÃO local orbitSpeed = 10 local orbitRadius = 20 -- valor inicial maior que 10 local angle = 0 local orbitMode = "Player" -- "Player" ou "Block" local orbiting = false local blockVisible = true -- VARIÁVEIS local orbitConnection local humanoidRootPart local previewBlock local orbitBlock local previewConnection -------------------------------------------------- -- TARGET PLAYER -------------------------------------------------- local function getNearestPlayer() local nearest local dist = math.huge for _, p in pairs(Players:GetPlayers()) do if p ~= player and p.Character and p.Character:FindFirstChild("HumanoidRootPart") then local mag = (humanoidRootPart.Position - p.Character.HumanoidRootPart.Position).Magnitude if mag < dist then dist = mag nearest = p.Character.HumanoidRootPart end end end return nearest end -------------------------------------------------- -- PREVIEW BLOCK -------------------------------------------------- local function createPreview() if previewBlock then previewBlock:Destroy() end previewBlock = Instance.new("Part") previewBlock.Size = Vector3.new(1,1,1) previewBlock.Anchored = true previewBlock.CanCollide = false previewBlock.Transparency = blockVisible and 0.5 or 1 previewBlock.Color = Color3.fromRGB(255,0,0) previewBlock.Parent = workspace if previewConnection then previewConnection:Disconnect() end previewConnection = RunService.RenderStepped:Connect(function() if orbitMode == "Block" and humanoidRootPart and previewBlock then local pos = humanoidRootPart.Position + humanoidRootPart.CFrame.LookVector * 8 previewBlock.Position = pos end end) end -------------------------------------------------- -- SPAWN BLOCK (mobile / botão) -------------------------------------------------- local function spawnBlock() if orbitMode == "Block" and previewBlock then if orbitBlock then orbitBlock:Destroy() end orbitBlock = previewBlock:Clone() orbitBlock.Transparency = 0.5 orbitBlock.Parent = workspace end end -------------------------------------------------- -- CREATE BLOCK CLICK (mouse) -------------------------------------------------- UIS.InputBegan:Connect(function(input, gp) if gp then return end if orbitMode == "Block" and input.UserInputType == Enum.UserInputType.MouseButton1 then spawnBlock() end end) -------------------------------------------------- -- ORBIT SYSTEM -------------------------------------------------- local function startOrbit() if orbitConnection then orbitConnection:Disconnect() end orbitConnection = RunService.RenderStepped:Connect(function(dt) if not humanoidRootPart then return end local target if orbitMode == "Player" then target = getNearestPlayer() else target = orbitBlock end if not target then return end angle = angle + orbitSpeed * dt local offset = Vector3.new( math.cos(angle) * orbitRadius, 0, math.sin(angle) * orbitRadius ) local pos = target.Position + offset humanoidRootPart.CFrame = CFrame.lookAt(pos, target.Position) end) end local function toggleOrbit() orbiting = not orbiting if orbiting then startOrbit() else if orbitConnection then orbitConnection:Disconnect() end end end -------------------------------------------------- -- GUI CONTROL -------------------------------------------------- local function createAdjuster(parent, yPos, labelName, valueVar, setValue, minValue) local frame = Instance.new("Frame", parent) frame.Size = UDim2.new(.8,0,.12,0) frame.Position = UDim2.new(.1,0,yPos,0) frame.BackgroundTransparency = 1 local label = Instance.new("TextLabel", frame) label.Size = UDim2.new(1,0,.4,0) label.BackgroundTransparency = 1 label.Text = labelName label.TextColor3 = Color3.new(1,1,1) label.Font = Enum.Font.GothamBold label.TextScaled = true local control = Instance.new("Frame", frame) control.Size = UDim2.new(1,0,.6,0) control.Position = UDim2.new(0,0,.4,0) control.BackgroundTransparency = 1 local minus = Instance.new("TextButton", control) minus.Size = UDim2.new(.3,0,1,0) minus.Text = "<" minus.Font = Enum.Font.GothamBold minus.TextScaled = true minus.BackgroundColor3 = Color3.new(0,0,0) minus.TextColor3 = Color3.new(1,1,1) local value = Instance.new("TextLabel", control) value.Size = UDim2.new(.4,0,1,0) value.Position = UDim2.new(.3,0,0,0) value.BackgroundTransparency = 1 value.Text = tostring(valueVar()) value.TextColor3 = Color3.new(1,1,1) value.Font = Enum.Font.GothamBold value.TextScaled = true local plus = Instance.new("TextButton", control) plus.Size = UDim2.new(.3,0,1,0) plus.Position = UDim2.new(.7,0,0,0) plus.Text = ">" plus.Font = Enum.Font.GothamBold plus.TextScaled = true plus.BackgroundColor3 = Color3.new(0,0,0) plus.TextColor3 = Color3.new(1,1,1) minus.MouseButton1Click:Connect(function() local new = math.max(minValue, valueVar() - 10) setValue(new) value.Text = tostring(new) end) plus.MouseButton1Click:Connect(function() local new = valueVar() + 10 setValue(new) value.Text = tostring(new) end) end -------------------------------------------------- -- GUI -------------------------------------------------- local function createGUI() local gui = Instance.new("ScreenGui") gui.Parent = player:WaitForChild("PlayerGui") gui.ResetOnSpawn = false local frame = Instance.new("Frame") frame.Parent = gui frame.Size = UDim2.new(0,260,0,320) frame.Position = UDim2.new(.5,-130,.5,-160) frame.BackgroundColor3 = Color3.fromRGB(30,30,30) frame.Active = true frame.Draggable = true Instance.new("UICorner", frame) -- menu piscando local corIndice = 0 RunService.RenderStepped:Connect(function(dt) corIndice = corIndice + dt * 2 frame.BackgroundColor3 = Color3.fromHSV(corIndice % 1, 1, 1) end) local title = Instance.new("TextLabel") title.Parent = frame title.Size = UDim2.new(1,0,0.1,0) title.Position = UDim2.new(0,0,0,0) title.Text = "Orbit Controller" title.BackgroundTransparency = 1 title.TextColor3 = Color3.new(1,1,1) title.Font = Enum.Font.GothamBold title.TextScaled = true -- Criador local creatorLabel = Instance.new("TextLabel") creatorLabel.Parent = frame creatorLabel.Size = UDim2.new(1,0,0.05,0) creatorLabel.Position = UDim2.new(0,0,0.1,0) creatorLabel.Text = "Script creator:CryptoCodeSupreme" creatorLabel.BackgroundTransparency = 1 creatorLabel.TextColor3 = Color3.new(1,1,1) creatorLabel.Font = Enum.Font.GothamBold creatorLabel.TextScaled = true -- SPEED createAdjuster(frame, 0.15, "Speed", function() return orbitSpeed end, function(v) orbitSpeed = v end, 0) -- DISTANCE createAdjuster(frame, 0.3, "Distance", function() return orbitRadius end, function(v) orbitRadius = v end, 10) -- MODE local modeBtn = Instance.new("TextButton", frame) modeBtn.Size = UDim2.new(.8,0,.12,0) modeBtn.Position = UDim2.new(.1,0,.45,0) modeBtn.Text = "Mode: Player" modeBtn.Font = Enum.Font.GothamBold modeBtn.TextScaled = true modeBtn.BackgroundColor3 = Color3.new(0,0,0) modeBtn.TextColor3 = Color3.new(1,1,1) modeBtn.MouseButton1Click:Connect(function() if orbitMode == "Player" then orbitMode = "Block" modeBtn.Text = "Mode: Block" createPreview() else orbitMode = "Player" modeBtn.Text = "Mode: Player" if previewBlock then previewBlock.Position = Vector3.new(0, -9999, 0) end end end) -- START / STOP local startBtn = Instance.new("TextButton", frame) startBtn.Size = UDim2.new(.8,0,.12,0) startBtn.Position = UDim2.new(.1,0,.6,0) startBtn.Text = "Start / Stop Orbit" startBtn.Font = Enum.Font.GothamBold startBtn.TextScaled = true startBtn.BackgroundColor3 = Color3.new(0,0,0) startBtn.TextColor3 = Color3.new(1,1,1) startBtn.MouseButton1Click:Connect(toggleOrbit) -- SPAWN BLOCK (mobile) local spawnBtn = Instance.new("TextButton", frame) spawnBtn.Size = UDim2.new(.8,0,.12,0) spawnBtn.Position = UDim2.new(.1,0,.72,0) spawnBtn.Text = "Spawn Block" spawnBtn.Font = Enum.Font.GothamBold spawnBtn.TextScaled = true spawnBtn.BackgroundColor3 = Color3.new(0,0,0) spawnBtn.TextColor3 = Color3.new(1,1,1) spawnBtn.MouseButton1Click:Connect(spawnBlock) -- DELETE BLOCK local deleteBtn = Instance.new("TextButton", frame) deleteBtn.Size = UDim2.new(.8,0,.12,0) deleteBtn.Position = UDim2.new(.1,0,.84,0) deleteBtn.Text = "Delete Block" deleteBtn.Font = Enum.Font.GothamBold deleteBtn.TextScaled = true deleteBtn.BackgroundColor3 = Color3.new(0,0,0) deleteBtn.TextColor3 = Color3.new(1,1,1) deleteBtn.MouseButton1Click:Connect(function() if orbitBlock then orbitBlock:Destroy() orbitBlock = nil end end) end -------------------------------------------------- -- CHARACTER -------------------------------------------------- local function onCharacter(char) humanoidRootPart = char:WaitForChild("HumanoidRootPart") end if player.Character then onCharacter(player.Character) end player.CharacterAdded:Connect(onCharacter) -------------------------------------------------- -- INICIAR GUI -------------------------------------------------- createGUI()