local mouse = game.Players.LocalPlayer:GetMouse()
local running = false
local staminaBar = game.Players.LocalPlayer.PlayerGui.StatusBar.Components.StaminaFrame.Progress
local duration = 0.1
function getTool()
for _, kid in ipairs(script.Parent:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
mouse.KeyDown:connect(function (key) -- Run function
key = string.lower(key)
if string.byte(key) == 48 then
running = true
local keyConnection = mouse.KeyUp:connect(function (key)
if string.byte(key) == 48 then
running = false
end
end)
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (70+(i*2))
wait()
end
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 24
staminaBar:WaitForChild("staminaLeft")
repeat
wait (duration)
staminaBar.staminaLeft.Value = staminaBar.staminaLeft.Value - 0.1 --VALUE Here
staminaBar.Size = UDim2.new(staminaBar.Size.X.Scale-0.01,0,staminaBar.Size.Y.Scale,0)
until running == false
keyConnection:disconnect()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (80-(i*2))
wait()
end
end
end)
COMMUNITY QUESTION
When I press shift this value isn't decreasing, why?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
What value?