How to make a shift to sprint script!! | Roblox Studio 2025

Опубликовано: 29 Июль 2026
на канале: Thvnd3rZ
80
3

In todays video i will be showing you how to make a working shift to sprint system

Socials -

Discord - discord.com/users/1282287881376890942

Tiktok - tiktok.com/‪@brutalbeatdown.official‬ (need to change name to Wxdy Stxdios)

Youtube -    / @wxdystudios  


Sprint Script -

Copy from line underneath

-- SprintSystem (Hold Shift to Sprint)
-- Includes animation and soft looping wind sound

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local Lighting = game:GetService("Lighting")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

-- CONFIG
local SPRINT_KEY = Enum.KeyCode.LeftShift
local NORMAL_SPEED = 16
local SPRINT_SPEED = 36
local ANIM_ID = "rbxassetid://109818832310253"
local WIND_SOUND_ID = "rbxassetid://9125554047" -- soft wind loop (you can replace)
local WIND_VOLUME = 0.3

-- Animation setup
local sprintAnim = Instance.new("Animation")
sprintAnim.AnimationId = ANIM_ID
local sprintTrack = humanoid:LoadAnimation(sprintAnim)
sprintTrack.Looped = true


-- Wind sound setup
local windSound = Instance.new("Sound")
windSound.SoundId = WIND_SOUND_ID
windSound.Looped = true
windSound.Volume = WIND_VOLUME
windSound.Name = "SprintWind"


local function attachSound()
local hrp = character:FindFirstChild("HumanoidRootPart")
if hrp and not hrp:FindFirstChild("SprintWind") then
windSound:Clone().Parent = hrp
end
end

local function startSprinting()
if sprinting then return end
sprinting = true
humanoid.WalkSpeed = SPRINT_SPEED

if not sprintTrack.IsPlaying then
sprintTrack:Play()
end

blur.Enabled = false
TweenService:Create(blur, TweenInfo.new(0.3), {Size = 8}):Play()

attachSound()
local hrp = character:FindFirstChild("HumanoidRootPart")
local sound = hrp and hrp:FindFirstChild("SprintWind")
if sound and not sound.IsPlaying then
sound:Play()
end

swayConnection = RunService.RenderStepped:Connect(function(dt)
timeElapsed += dt * swaySpeed
local swayX = math.sin(timeElapsed) * swayAmplitude
local swayY = math.cos(timeElapsed * 2) * (swayAmplitude / 2)
camera.CFrame = camera.CFrame * CFrame.Angles(math.rad(swayY), math.rad(swayX), 0)
end)
end

local function stopSprinting()
if not sprinting then return end
sprinting = false
humanoid.WalkSpeed = NORMAL_SPEED

if sprintTrack.IsPlaying then
sprintTrack:Stop()
end

TweenService:Create(blur, TweenInfo.new(0.3), {Size = 0}):Play()
task.delay(0.4, function()
if not sprinting then blur.Enabled = false end
end)

local hrp = character:FindFirstChild("HumanoidRootPart")
local sound = hrp and hrp:FindFirstChild("SprintWind")
if sound and sound.IsPlaying then
sound:Stop()
end

if swayConnection then
swayConnection:Disconnect()
swayConnection = nil
end
end

UserInputService.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == SPRINT_KEY then
startSprinting()
end
end)

UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == SPRINT_KEY then
stopSprinting()
end
end)

player.CharacterAdded:Connect(function(char)
character = char
humanoid = character:WaitForChild("Humanoid")
sprintTrack = humanoid:LoadAnimation(sprintAnim)
sprintTrack.Looped = true
end)