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

Need help on Ad Cash! Help please?

Asked by 9 years ago

Hey guys, I need help on making an Ad Cash GUI. The ad worked and showed up on mobile, but the promised reward of 5000 cash wasn't awarded. I am using berezaa's tycoon kit. I do not know what is wrong with the script. What is wrong with it? Can someone fix it?

function run()
game:GetService("AdService"):ShowVideoAd()

game:GetService("AdService").VideoAdClosed:connect(function()
    print("Finished showing video ad.")
    stats=game.ServerStorage:WaitForChild("MoneyStorage")
    if stats~=nil then
        currency = stats:WaitForChild(Player.Name)
        if currency~=nil then
            bonus=script:WaitForChild("AdCash")
            currency.Value = currency.Value+bonus.Value
        end
    end
end)

end

script.Parent.TouchTap:connect(run)

UPDATE : I edited the script line 10. The script line content is now "bonus=script.Parent:WaitForChild("AdCash")"

1 answer

Log in to vote
0
Answered by 9 years ago

try to add this lines into yours to let it works with berzaa tycoon kit!

        local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
        if cashmoney then
            cashmoney.Value = cashmoney.Value + 5000
        end

or add this one

        local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(user.Name) 
        if cashmoney ~= nil then  
        cashmoney.Value = cashmoney.Value + 5000
        end

the last one may work better!

0
I added it and replaced some lines of code, I will try it later on the mobile version of ROBLOX. Thanks! PlantChampion 136 — 9y
0
If it worked or helped accept my answer :D minetrackmania 186 — 9y
Ad

Answer this question