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

Need help on Ad Cash! Help please?

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

✓ Accepted answer

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!

2 comments

0

I added it and replaced some lines of code, I will try it later on the mobile version of ROBLOX. Thanks!

0

If it worked or helped accept my answer :D

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