Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local stamina = 100 local maxStamina = 100 local staminaDrain = 1 local staminaRegen = 0.5 local isSprinting = false local normalspeed = 16 local sprintspeed = 32 local staminaGui = player.PlayerGui:WaitForChild("StaminaGui") local staminaBackground = staminaGui:WaitForChild("StaminaBackground") local staminaFill = staminaBackground:WaitForChild("StaminaFill") staminaFill.Size = UDim2.new(stamina / maxStamina, 0, 1, 0) local function regenerateStamina() if stamina < maxStamina then stamina = math.min(stamina + staminaRegen, maxStamina) staminaFill.Size = UDim2.new(stamina / maxStamina, 0, 1, 0) end end local function toggleSprint() if stamina > 0 and humanoid.WalkSpeed > 0 then isSprinting = true humanoid.WalkSpeed = sprintspeed else isSprinting = false humanoid.WalkSpeed = normalspeed end end local function onInputBegan(input) if input.UserInputType == Enum.UserInputType.Keyboard then if input.KeyCode == Enum.KeyCode.LeftShift then if stamina > 0 and humanoid.WalkSpeed > 0 then toggleSprint() end end end end local function onInputEnded(input) if input.UserInputType == Enum.UserInputType.Keyboard then if input.KeyCode == Enum.KeyCode.LeftShift then isSprinting = false humanoid.WalkSpeed = normalspeed end end end game:GetService("UserInputService").InputBegan:Connect(onInputBegan) game:GetService("UserInputService").InputEnded:Connect(onInputEnded) game:GetService("RunService").Heartbeat:Connect(function() if isSprinting and stamina > 0 then stamina = math.max(stamina - staminaDrain, 0) staminaFill.Size = UDim2.new(stamina / maxStamina, 0, 1, 0) else regenerateStamina() end if stamina == 0 and isSprinting then isSprinting = false humanoid.WalkSpeed = normalspeed end end)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)