ShowVideoAd does not error if it doesn't show the ad

I’m relying on VideoAdClosed firing to tell the server to respawn the character. Instead, they don’t even see an ad and they get their character deleted until they leave. I need it to error so I don’t delete their character expecting them to be able to respawn.

ShowVideoAd is not an yielding method and can’t wait to see whether an ad can actually be shown and throw and error if it isn’t.

VideoAdClosed will always fire whether an ad was shown or not. VideoAdClosed has an “adShown” boolean which should tell you whether an ad was shown or not but this currently always returns true.

The current best way to check if an ad was actually shown is like this:

local adServiceClickTick = nil
game:GetService("AdService").VideoAdClosed:connect(function()
    if os.time() - adServiceClickTick > 10 then 
        --player actually was shown an ad (10 seconds have passed)
    end
end)

function showVideoAd()
    adServiceClickTick = os.time()
    game:GetService("AdService"):ShowVideoAd()
end

-- You can call showVideoAd however you like here
script.Parent.MouseButton1Down:connect(showVideoAd)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.