speed script
Key RequiredUniversal

speed script

Universal Scriptmattpattmattpatt 1.2K views 13.5K executesUpdated Apr 8, 2026
Unrated
00
Lua Script•22 lines (945 chars)
-- LocalScript inside StarterPlayerScripts
-- Get the local player and their character
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
-- Movement settings
local speed = 16 -- studs per second
local run = true -- toggle movement
-- Move forward every frame
game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
    if run and humanoidRootPart then
        -- Move forward relative to the character's facing direction
        humanoidRootPart.CFrame = humanoidRootPart.CFrame * CFrame.new(0, 0, -speed * deltaTime)
    end
end)
-- Example: toggle movement with the "C" key
local userInputService = game:GetService("UserInputService")
userInputService.InputBegan:Connect(function(input, gameProcessed)
    if not gameProcessed and input.KeyCode == Enum.KeyCode.C then
        run = not run
    end
end)

Features & Information

idk

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts