Wrong reward for rewarded video

Hi all. Took the ad code with a reward from the unit guide and added a reward of +100 coins. After the first viewing, 100 is charged (as it should be), but then, after viewing the second time, the third - the reward increases by a multiple (200, 400, 800 coins). What is the problem? Help, please.

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Advertisements;
public class RewardedAdsButton : MonoBehaviour, IUnityAdsLoadListener, IUnityAdsShowListener
{
    [SerializeField] Button _showAdButton;
    [SerializeField] string _androidAdUnitId = "Rewarded_Android";
    [SerializeField] string _iOSAdUnitId = "Rewarded_iOS";
    string _adUnitId = null; // This will remain null for unsupported platforms
    void Awake()
    {  
        // Get the Ad Unit ID for the current platform:
#if UNITY_IOS
        _adUnitId = _iOSAdUnitId;
#elif UNITY_ANDROID
        _adUnitId = _androidAdUnitId;
#endif

        //Disable the button until the ad is ready to show:
        _showAdButton.interactable = false;
    }
    // Load content to the Ad Unit:
    public void LoadAd()
    {
        // IMPORTANT! Only load content AFTER initialization (in this example, initialization is handled in a different script).
        Debug.Log("Loading Ad: " + _adUnitId);
        Advertisement.Load(_adUnitId, this);
    }
    // If the ad successfully loads, add a listener to the button and enable it:
    public void OnUnityAdsAdLoaded(string adUnitId)
    {
        Debug.Log("Ad Loaded: " + adUnitId);
        if (adUnitId.Equals(_adUnitId))
        {
            // Configure the button to call the ShowAd() method when clicked:
            _showAdButton.onClick.AddListener(ShowAd);
            // Enable the button for users to click:
            _showAdButton.interactable = true;
        }
    }
    // Implement a method to execute when the user clicks the button:
    public void ShowAd()
    {
        // Disable the button:
        _showAdButton.interactable = false;
        // Then show the ad:
        Advertisement.Show(_adUnitId, this);
    }
    // Implement the Show Listener's OnUnityAdsShowComplete callback method to determine if the user gets a reward:
    public void OnUnityAdsShowComplete(string adUnitId, UnityAdsShowCompletionState showCompletionState)
    {
        if (adUnitId.Equals(_adUnitId) && showCompletionState.Equals(UnityAdsShowCompletionState.COMPLETED))
        {
            Debug.Log("Unity Ads Rewarded Ad Completed");
            int coins = PlayerPrefs.GetInt ("coins");
            coins += 100;
            PlayerPrefs.SetInt("coins", coins);
            // Grant a reward.
            Debug.Log("+100 coins");

            // Load another ad:
            Advertisement.Load(_adUnitId, this);
        }
    }
    // Implement Load and Show Listener error callbacks:
    public void OnUnityAdsFailedToLoad(string adUnitId, UnityAdsLoadError error, string message)
    {
        Debug.Log($"Error loading Ad Unit {adUnitId}: {error.ToString()} - {message}");
        // Use the error details to determine whether to try to load another ad.
    }
    public void OnUnityAdsShowFailure(string adUnitId, UnityAdsShowError error, string message)
    {
        Debug.Log($"Error showing Ad Unit {adUnitId}: {error.ToString()} - {message}");
        // Use the error details to determine whether to try to load another ad.
    }
    public void OnUnityAdsShowStart(string adUnitId) { }
    public void OnUnityAdsShowClick(string adUnitId) { }
    void OnDestroy()
    {
        // Clean up the button listeners:
        _showAdButton.onClick.RemoveAllListeners();
    }
}

This line here

_showAdButton.onClick.AddListener(ShowAd);

Might be adding multiple listeners. So, since you have your debug statement of +100 coins, how many times do you see that trigger after each ad viewing?

Note, this makes sense because after the first ad view, you’re calling to load another, which would then make it where you have 2 listeners. So then if those both trigger, you’d have 4 listeners. Then 8, etc.

[quote=“Brathnann, post:2, topic: 892988, username:Brathnann”]
how many times do you see that trigger after each ad viewing?
[/quote] - First 1, then 3, 8, 21. These are the reward receiving messages and the ad end messages.

Here

Brathann already told you what was wrong, can you not fix it yourself?

[quote=“RadRedPanda, post:5, topic: 892988, username:RadRedPanda”]
Brathann already told you what was wrong, can you not fix it yourself?
[/quote] Sorry, i’m new to scripting and I really don’t know what to do.