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

Why Won't this work?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

It's meant to show a Video Ad and give the player his reward, but nothing happens... Help? No output too...

debounce = false
script.Parent.Touched:connect(function()
    if debounce == false then
        debounce = true
        game:GetService("AdService"):ShowVideoAd()
    end
end)
game:GetService("AdService").VideoAdClosed:connect(function()
    local a = math.random(1,10)
    game.Players.LocalPlayer.stats.Cash = game.Players.LocalPlayer.stats.Cash + a
    game.Players.LocalPlayer.PlayerGui.ScreenGui.Notice.TextButton.Text = "You have earnt "..a.." Cash from the Video."
    wait(60)
    debounce = false
end)

I'm fairly certain that it's LocalPlayer.stats. Those stats aren't meant to be visible to anyone but the player.

0
Try adding a few `print` statements to see if the code is ever actually running. adark 5487 — 10y
0
Still. I put "Brick Touched" Right after the event and not even THAT would print... fahmisack123 385 — 10y
0
Are you on a mobile device? Video Ads only show if you're on a mobile device. Merely 2122 — 10y
0
Thanks for the obvious, Merely. I have tested it on all platforms and nothing. It would be nice to have a developer console on Mobile though fahmisack123 385 — 10y

Answer this question