Universal Script 📌
1.2k Views
731 Executions

Acceleration v2

Universal Script 📌
Valzx
ValzxPublished 5
10 months 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

its now All movements, since so many are having problems New: ALL MOVEMENTS

View Raw
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer

local function startClientAccel(char)
    local humanoid = char:WaitForChild("Humanoid")
    local hrp = char:WaitForChild("HumanoidRootPart")

    local speed = 0 -- i recommend u use 0.2 or 0.1, but i chose 0 since its universal
    local maxSpeed = 27 -- Change if u wanna :3
    local accel = 0.15 -- how fast it uhm accelerates
    local decel = 23 -- when u stop, this is the oppisite of accel
    local moving = false

    humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
        moving = humanoid.MoveDirection.Magnitude > 0
    end)

    RunService.RenderStepped:Connect(function(dt)
        if not hrp or not hrp.Parent then return end

        if moving then
            speed = math.min(speed + accel * dt * 10, maxSpeed)
        else
            speed = math.max(speed - decel * dt * 10, 0)
        end

        if speed > 0.1 then
            -- Use MoveDirection instead of camera
            local moveDir = humanoid.MoveDirection
            if moveDir.Magnitude > 0 then
                local offset = moveDir.Unit * speed * dt
                hrp.CFrame = hrp.CFrame + offset
            end
        end
    end)
end

if player.Character then


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Universal Script 📌
6
0
Approved 18 minutes ago
Universal Script 📌
25
1
Approved 46 minutes ago
Universal Script 📌
30
8
Approved 48 minutes ago