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")"
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!