Run test video ads while testing in Roblox Studio

Hello I would like to have a way to run fake/test video ads to test my rewards to see if they work correctly.
My game where I’m adding this feature is available and has more than 2000 unique players per month but I can’t test my ad system I even tried to test in-game to see if I can watch an ad but it didn’t work. I think my code is good but there’s no ad available to watch because I ask to the server to look for an for the player before the player asks.
And it always fails to look for ads.
image

Please add this and it would be very helpful to get ready to support them correctly for the players because I don’t know yet if it would crash!

-- AD AVAILABILITY CHECK
local function checkAdAvailability(player)
	-- Skip if player already has an ad available or global limit reached
	if playersNeedingAds[player.UserId] == false then
		return
	end
	
	-- Check global ad limit
	if currentAdCount >= GLOBAL_AD_LIMIT then
		-- Already have enough ads globally, skip this check
		return
	end
	
	local success, canShow = pcall(function()
		return AdService:CanShowRewardedVideoAdAsync(player)
	end)
	if success then
		adAvailability[player.UserId] = canShow
		print("Ad availability for", player.Name, "->", canShow, "| Global count:", currentAdCount)
		-- Notify client of ad availability
		local adAvailableRemote = ReplicatedStorage:FindFirstChild("AdAvailable")
		if adAvailableRemote then
			adAvailableRemote:FireClient(player, canShow)
		end
		-- Stop checking if ad found and increment global count
		if canShow then
			playersNeedingAds[player.UserId] = false
			currentAdCount = currentAdCount + 1
			print("Ad found! Global ad count now:", currentAdCount, "/", GLOBAL_AD_LIMIT)
		end
	else
		adAvailability[player.UserId] = false
		warn("Failed to check ad availability for", player.Name)
	end
end
3 Likes

what device are you using for testing?

It’s obvious I’m using a computer for Roblox Studio, a windows one. I later tested with my phone and I didn’t see any available ad in the game I’m working on.

hold on

there’s no such method in AdService

remove pcall and see what happens.

you’re right. The thing is I tried to mimic the system of Toilet Defense Simulator who waits for an available ad. I don’t know how to do it if not.
I just realized the request I need to do is client sided not server sided, thank you for noticing!