Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[local ScreenGui = Instance.new("ScreenGui")
- local RunButton = Instance.new("ImageButton")
- local Stamina = Instance.new("Frame")
- local RunButtonUICorner = Instance.new("UICorner")
- local StaminaUICorner = Instance.new("UICorner")
- local UserInputService = game:GetService("UserInputService")
- local stamina = 20
- local running = false
- stamina = math.clamp(stamina,0,28)
- ScreenGui.Parent = game.CoreGui
- Stamina.Name = "Stamina"
- Stamina.Parent = ScreenGui
- Stamina.Position = UDim2.new(0, 0, 0.95, 0)
- Stamina.Size = UDim2.new(stamina/20,0,0.02,0)
- Stamina.BackgroundColor3 = Color3.new(50, 222, 0)
- Stamina.BorderSizePixel = 0
- Stamina.BackgroundTransparency = 0.5
- RunButton.Name = "RunButton"
- RunButton.Parent = ScreenGui
- RunButton.Position = UDim2.new(0.8, 0, 0.4, 0)
- RunButton.Size = UDim2.new(0, 50, 0, 50)
- RunButton.BackgroundColor3 = Color3.new(255, 255, 255)
- RunButton.Image = "rbxassetid://15527612616"
- RunButton.MouseButton1Down:connect(function()
- if RunButton.Image == "rbxassetid://15527612616" then
- RunButton.Image = "rbxassetid://15527570851"
- running = true
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 20
- while stamina > 0 and running do
- stamina = stamina - 0.05
- Stamina:TweenSize(UDim2.new(stamina/ 20,0,0.02,0), "Out","Linear",0)
- wait()
- if stamina < 1 then
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 10
- end
- end
- else
- if RunButton.Image == "rbxassetid://15527570851" then
- RunButton.Image = "rbxassetid://15527612616"
- running = false
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 10
- while stamina < 20 and not running do
- stamina = stamina + 0.05
- Stamina:TweenSize(UDim2.new(stamina/20,0,0.02,0), "Out","Linear",0)
- wait()
- if stamina < 1 then
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 10
- end
- end
- end
- end
- end)
- RunButtonUICorner.Name = "RunButtonUICorner"
- RunButtonUICorner.Parent = RunButton
- RunButtonUICorner.CornerRadius = UDim.new(1, 1)
- StaminaUICorner.Name = "StaminaUICorner"
- StaminaUICorner.Parent = Stamina]]--
- --[[UserInputService.InputBegan:Connect(function(input)
- if input.KeyCode == Enum.KeyCode.LeftShift then
- running = true
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 20
- while stamina > 0 and running do
- stamina = stamina - 0.05
- Stamina:TweenSize(UDim2.new(stamina/ 20,0,0.02,0), "Out","Linear",0)
- wait()
- if stamina < 1 then
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 10
- end
- end
- else
- running = false
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 10
- while stamina < 20 and not running do
- stamina = stamina + 0.05
- Stamina:TweenSize(UDim2.new(stamina/20,0,0.02,0), "Out","Linear",0)
- wait()
- if stamina < 1 then
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 10
- end
- end
- end
- end)]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement