local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local rootPart local humanoid local REV_PER_SEC = 10 local ANG_SPEED = REV_PER_SEC * math.pi * 2 local spinning = false local spinConn = nil local function attach(char) rootPart = char:WaitForChild("HumanoidRootPart", 5) humanoid = char:FindFirstChildOfClass("Humanoid") end attach(player.Character or player.CharacterAdded:Wait()) player.CharacterAdded:Connect(attach) local function startSpin() if spinning or not rootPart then return end spinning = true if humanoid then humanoid.AutoRotate = false end spinConn = RunService.RenderStepped:Connect(function(dt) if not rootPart.Parent then return end rootPart.CFrame = rootPart.CFrame * CFrame.Angles(0, ANG_SPEED * dt, 0) end) end local function stopSpin() if not spinning then return end spinning = false if spinConn then spinConn:Disconnect() spinConn = nil end if humanoid then humanoid.AutoRotate = true end end UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if input.KeyCode == Enum.KeyCode.F then if spinning then stopSpin() else startSpin() end end end)