local Players = game:GetService("Players") local player = Players.LocalPlayer -- === SETTINGS === local spinning = true local rotateX, rotateY, rotateZ = true, true, true local angleX, angleY, angleZ = 90, 90, 90 local delayMin, delayMax = 5, 10 local spinThread = nil -- === ROTATION FUNCTION === local function startSpinning(character) local rootPart = character:WaitForChild("HumanoidRootPart") while spinning and character and character.Parent do local rx = rotateX and math.rad(math.random(-angleX, angleX)) or 0 local ry = rotateY and math.rad(math.random(-angleY, angleY)) or 0 local rz = rotateZ and math.rad(math.random(-angleZ, angleZ)) or 0 -- Cumulative rotation (adds on top of existing orientation) rootPart.CFrame = rootPart.CFrame * CFrame.Angles(rx, ry, rz) task.wait(math.random(delayMin, delayMax)) end end local function startOrStopSpinning(character) if spinThread then spinThread = nil end if spinning and character then spinThread = coroutine.create(startSpinning) coroutine.resume(spinThread, character) end end -- === GUI CREATION === local function createUI() local screenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui")) screenGui.Name = "RotationControlGUI" screenGui.ResetOnSpawn = false local frame = Instance.new("Frame", screenGui) frame.Size = UDim2.new(0, 300, 0, 460) frame.Position = UDim2.new(0.5, -150, 0.5, -230) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BorderSizePixel = 0 frame.Active = true frame.Draggable = true Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 6) local header = Instance.new("Frame", frame) header.Size = UDim2.new(1, 0, 0, 30) header.BackgroundTransparency = 1 local title = Instance.new("TextLabel", header) title.Size = UDim2.new(1, -60, 1, 0) title.Position = UDim2.new(0, 5, 0, 0) title.BackgroundTransparency = 1 title.Text = "Rotation Control" title.Font = Enum.Font.GothamBold title.TextColor3 = Color3.new(1, 1, 1) title.TextSize = 18 title.TextXAlignment = Enum.TextXAlignment.Left -- Close Button local closeBtn = Instance.new("TextButton", header) closeBtn.Size = UDim2.new(0, 24, 0, 24) closeBtn.Position = UDim2.new(1, -28, 0, 3) closeBtn.BackgroundColor3 = Color3.fromRGB(200, 50, 50) closeBtn.Text = "X" closeBtn.Font = Enum.Font.GothamBold closeBtn.TextColor3 = Color3.new(1, 1, 1) closeBtn.TextSize = 14 closeBtn.MouseButton1Click:Connect(function() screenGui:Destroy() end) -- Minimize Button local minimized = false local minimizeBtn = Instance.new("TextButton", header) minimizeBtn.Size = UDim2.new(0, 24, 0, 24) minimizeBtn.Position = UDim2.new(1, -58, 0, 3) minimizeBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 200) minimizeBtn.Text = "-" minimizeBtn.Font = Enum.Font.GothamBold minimizeBtn.TextColor3 = Color3.new(1, 1, 1) minimizeBtn.TextSize = 14 -- Content container local content = Instance.new("Frame", frame) content.Name = "Content" content.Position = UDim2.new(0, 0, 0, 30) content.Size = UDim2.new(1, 0, 1, -30) content.BackgroundTransparency = 1 -- Toggle creator local function createToggle(labelText, getState, toggleFunc, yOffset) local btn = Instance.new("TextButton", content) btn.Size = UDim2.new(1, -20, 0, 28) btn.Position = UDim2.new(0, 10, 0, yOffset) btn.BackgroundColor3 = Color3.fromRGB(70, 70, 70) btn.Font = Enum.Font.Gotham btn.TextColor3 = Color3.new(1, 1, 1) btn.TextSize = 14 local function update() btn.Text = labelText .. ": " .. (getState() and "ON" or "OFF") end btn.MouseButton1Click:Connect(function() toggleFunc() update() if labelText == "Spinning" then startOrStopSpinning(player.Character) end end) update() end local function createInput(label, default, callback, yOffset) local labelObj = Instance.new("TextLabel", content) labelObj.Size = UDim2.new(1, -20, 0, 20) labelObj.Position = UDim2.new(0, 10, 0, yOffset) labelObj.BackgroundTransparency = 1 labelObj.Text = label labelObj.Font = Enum.Font.Gotham labelObj.TextColor3 = Color3.new(1, 1, 1) labelObj.TextSize = 14 local input = Instance.new("TextBox", content) input.Size = UDim2.new(1, -20, 0, 26) input.Position = UDim2.new(0, 10, 0, yOffset + 20) input.BackgroundColor3 = Color3.fromRGB(60, 60, 60) input.Text = tostring(default) input.ClearTextOnFocus = false input.Font = Enum.Font.Gotham input.TextColor3 = Color3.new(1, 1, 1) input.TextSize = 14 input.FocusLost:Connect(function() local num = tonumber(input.Text) if num then callback(num) else input.Text = tostring(default) end end) end local y = 10 createToggle("Spinning", function() return spinning end, function() spinning = not spinning end, y); y += 35 createToggle("X Axis", function() return rotateX end, function() rotateX = not rotateX end, y); y += 35 createToggle("Y Axis", function() return rotateY end, function() rotateY = not rotateY end, y); y += 35 createToggle("Z Axis", function() return rotateZ end, function() rotateZ = not rotateZ end, y); y += 35 createInput("X Rotation Max", angleX, function(v) angleX = math.clamp(v, 0, 360) end, y); y += 60 createInput("Y Rotation Max", angleY, function(v) angleY = math.clamp(v, 0, 360) end, y); y += 60 createInput("Z Rotation Max", angleZ, function(v) angleZ = math.clamp(v, 0, 360) end, y); y += 60 createInput("Delay Min", delayMin, function(v) delayMin = math.max(0, v) end, y); y += 60 createInput("Delay Max", delayMax, function(v) delayMax = math.max(0, v) end, y); y += 60 -- Minimize logic minimizeBtn.MouseButton1Click:Connect(function() minimized = not minimized content.Visible = not minimized minimizeBtn.Text = minimized and "+" or "-" frame.Size = minimized and UDim2.new(0, 300, 0, 40) or UDim2.new(0, 300, 0, 460) end) end -- === CHARACTER SPAWN HOOK === player.CharacterAdded:Connect(function(char) if spinning then startOrStopSpinning(char) end end) if player.Character then startOrStopSpinning(player.Character) end createUI()