Feel free to use these
local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local character = nil local humanoid = nil local isRunning = false local runSpeed = 32 -- Speed while running local walkSpeed = 16 -- Normal walking speed local runDuration = 10 -- seconds -- Function to start running local function startRunning() if not isRunning and humanoid then isRunning = true humanoid.WalkSpeed = runSpeed task.delay(runDuration, function() if humanoid then humanoid.WalkSpeed = walkSpeed end isRunning = false end) end end -- Detect character spawn player.CharacterAdded:Connect(function(char) character = char humanoid = character:WaitForChild("Humanoid") end) -- Detect Shift key press UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.LeftShift then startRunning() end end)