Items might be a bit trickier I will have to look more into that later. But gold is relatively easy. You can have a parallel process run in the background checking for gold.
You need to set up:
1. A variable that grabs your current gold.
2. A variable that will be how much gold you want to limit your character to holding.
3. Change the value of your first variable by subtracting it from your limiter.
- That new value becomes how much of an overflow the character has.
- You change the gold by DECREASING the amount from the player and set the value to the first variable.
- This will ensure that your limiter is the MAX value you can have.
- Do not forget to set the IF statement. it needs to be Greater Than or Equal To 1 above the max.
==========================================================================================
EDIT : Actually I just found out about item possession counts.
If you do a parallel process that checks for all the possession of specific items on hand and then add them all up, you'll be able to get an inventory count. Then just like the gold, create a limiter. And when you exceed the max count, force prompt the player to throw away the item they just picked up so you need to check what item that was and remove it. Or annoyingly prompt the player to remove an item from their inventory.