Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Mobile Ads on Click?

function onClicked(playerWhoClicked)
game:GetService("AdService"):ShowVideoAd()
 
game:GetService("AdService").VideoAdClosed:connect(function()
	print("Finished showing video ad.")	
end)

I have this as a local script inside of a part. There is also a click detector inside of the part. However, ROBLOX keeps saying that there are unexpected things and such. I just want to be able to make it so that a mobile ad will play when the brick is clicked. Can anyone help me out?

1 comment

0

Include the error. There's a syntax error in at least this snippet that you posted; include it in the question.

1 answer

✓ Accepted answer

Ads can only be played on mobile devices. Since mobile devices do not have computer mice, the onClicked function will not work. Replace the ClickDetector with something like a Touched event.

This discussion is preserved as it was. New answers, comments, and votes are closed.