simple spin script
Key RequiredUniversal

simple spin script

Universal Scriptgentgent 2.9K views 530 executesUpdated Jul 4, 2025
Unrated
00
Lua Script•52 lines (1357 chars)
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)

Features & Information

spin (doesnt fling)

Community Comments (3)

gentgentJul 4, 2025

click f to spin

fodobefodobeJul 6, 2025

ain't no way bro makes his scripts with chatgpt 😭🙏

XerytXerytAug 2, 2025

I can tell this is gpt

More Scripts for Universal Scripts