Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Mobile Ads on Click?

Asked by 9 years ago
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?

0
Include the error. There's a syntax error in at least this snippet that you posted; include it in the question. BlueTaslem 18071 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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.

Ad

Answer this question