Universal Script 📌
2.9k Views
704 Executions

simple spin script

Universal Script 📌
gent
gentPublished 10
1 year 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

spin (doesnt fling)

View Raw
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()


Comments

3
Log in to join the conversation. Login
Xeryt's profile picture
Xeryt1 year ago

I can tell this is gpt

1
fodobe's profile picture
fodobe1 year ago

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

1
gent's profile picture
gentUploader1 year ago

click f to spin

1