HELP WITH REWARDED ADS

Hello guys im currently working on a game but my rewarded ads script works perfectly its just it wont give me the money after the ads finished please help here is my script and if anyone has a script for the shop please can you share it or help me because im so confused about it

using UnityEngine;
using UnityEngine.Advertisements;

public class Ads : MonoBehaviour
{

public string moneyPlayerPrefs = “Money”;
public int moneyLeft = 0;

public void ShowRewardedAd()
{
if (Advertisement.IsReady(“rewardedVideo”))
{
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show(“rewardedVideo”, options);
}
}

private void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log(“The ad was successfully shown.”);

moneyLeft = PlayerPrefs.GetInt(moneyPlayerPrefs, moneyLeft);
moneyLeft = moneyLeft + 100;

// Give coins etc.
break;
case ShowResult.Skipped:
Debug.Log(“The ad was skipped before reaching the end.”);
break;
case ShowResult.Failed:
Debug.LogError(“The ad failed to be shown.”);
break;
}
}
}

I personally use serilizable saving. Binary. Easier to use. Check out this link scroll down and you’ll see my posts on binary saving.

In the game.cs file you could add public int gold;

And then in saveload.cs script you need to add

current.gold = Game.current.gold;

etc … and then replace this

moneyLeft = PlayerPrefs.GetInt(moneyPlayerPrefs, moneyLeft);
moneyLeft = moneyLeft + 100;

With this

Int _goldHolder = Game.current.gold;
Game.current.gold = _goldHolder + 100;
SaveLoad.SaveGame();

And then make sure this is loaded at the start of your game with SaveLoad.LoadGame();

Right now you’re grabbing a playerpref value and setting moneyLeft equal to that value, then adding 100 to it. But you never save it back to the playerpref, so every time an ad is viewed, you get the same value over and over again.

Also, you should consider not using playerprefs, it’s not secure for this type of thing.

Edit: to add, grabbing the playerpref when you award from ads is not the right place to grab it anyways.