Follow this guide if you are using UE4.

Go to the BP_MasterResource and copy the video below.

Go to the ResourceSetup function and copy the image below.

Go to the OnRep_Depleted function and copy the image below.