You are trying to game and record on a laptop mobile CPU. Laptops are not designed to game and record/stream with software encoding (i.e. x264) concurrently. More so if you have few cores and threads available. Sure, it **can** work but I would dial things down to avoid problems.
On a system like yours, best to stay away from x264 encoding which taxes the CPU. Use the onboard Nvidia GPU encoder instead. That will free the cores from x264's heavy CPU utilization and reduce CPU core temperatures too. Do this by going to OBS Advanced Output and choosing for the encoder Nvidia NVENC H.264 (new). Your GTX 1050 is Pascal chip and should support H.264 and H.265.
In addition, since an i5-8300H isn't the speediest CPU in the world, I would consider producing 720p output (1280x720) instead of your existing 1920x1080. Do this by going to OBS Video and changing Output Scaled Resolution to 1280x720. Also, since you are downscaling, you can use either Lanczos or Bicubic as the downscale filter.
Also, make sure you go to Nvidia and
download GeForce Experience to get the latest GPU drivers. Very important to do that once a month.