--[[ --------- ]]
--
function speed(run)
	if run then
		if not running then 
			running = true 
			script.Running.Value = true
			for i = 1, 8 do
				game.Workspace.CurrentCamera.FieldOfView = (90 + (i * 2))
				r.Stepped:wait()
			end
		end
	else
		if running then
			running = false
			script.Running.Value = false
			for i = 1, 8 do
				game.Workspace.CurrentCamera.FieldOfView = (90 - (i * 2))
				r.Stepped:wait()
			end
		end
	end
end
mouse.KeyDown:connect(function(key)
	if (string.byte(key:lower()) == 48)then
		script.Parent.LoadingBar.Stamina.Text = ("Stamina")
		speed(true)
		
		mouse.KeyUp:connect(function(key)
			if (string.byte(key:lower()) == 48)then
				speed(false)
			end
		end)
	end
end)

while true do
	r.Stepped:wait(0.10)
	if running then
		if not (Bar.Size == UDim2.new(0, 0, 0.9, 0)) then
			if not (Bar.Size.X.Scale - 0.01 <= 0) then
				Bar:TweenSize(UDim2.new((Bar.Size.X.Scale - 0.01), 0, Bar.Size.Y.Scale, 0), Out, "Sine", 0.10, true, nil)
			else
				Bar:TweenSize(UDim2.new(Bar.Size.X.Scale - (-(0-Bar.Size.X.Scale)), 0, Bar.Size.Y.Scale, 0),Out, "Sine", 0.10, true, nil)
			end
		else
			speed(false)
		end
		if Bar.Size.X.Scale < 0.05 then
			speed(false)
		end
	else
		if not (Bar.Size == UDim2.new(0.985, 0, 0.9, 0)) then
			if not (Bar.Size.X.Scale + 0.005 >= 0.985) then
				wait(0.15)
				Bar:TweenSize(UDim2.new((Bar.Size.X.Scale + 0.005), 0, Bar.Size.Y.Scale, 0), Out, "Sine", 0.10, true, nil)
			else
				wait(0.15)
				Bar:TweenSize(UDim2.new(Bar.Size.X.Scale + (0.985-Bar.Size.X.Scale), 0, 0.9, 0),Out, "Sine", 0.10, true, nil)
			end
		end
	end
end