--= Functions =--


UIS.InputBegan:connect(function(key, gameProcessed)
	if key.KeyCode == Enum.KeyCode.LeftShift and gameProcessed == false then
		character.Humanoid.WalkSpeed = NewWalkSpeed
		sprinting = true
		while power > 0 and sprinting do
			power = power - .03
			Bar.Size = UDim2.new(power / 10, 0, 1, 0)
			--Bar.BackgroundColor3 = Bar.BackgroundColor3:lerp(Color3.fromRGB(255, 42, 42), 0.001)
			tween:Play()
			wait()
			if power <= 0 then
				character.Humanoid.WalkSpeed = NormalWalkSpeed
			end
		end
	end
end)

UIS.InputEnded:connect(function(key, gameProcessed)
	if key.KeyCode == Enum.KeyCode.LeftShift and gameProcessed == false then
		character.Humanoid.WalkSpeed = NormalWalkSpeed
		sprinting = false
		while power < 10 and not sprinting do
			power = power + .03
			Bar.Size = UDim2.new(power / 10, 0, 1, 0)
			--Bar.BackgroundColor3 = Bar.BackgroundColor3:lerp(Color3.fromRGB(255, 166, 11), 0.001)
			tween2:Play()
			wait()
			if power <= 0 then
				character.Humanoid.WalkSpeed = NormalWalkSpeed
			end
		end
	end
end)
