generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Re: Help needed right quick

Previous Thread :: Next Thread 
darkside891 is not online. darkside891
Joined: 24 Jul 2013
Total Posts: 11
07 Aug 2015 06:54 PM
So I am working on a tycoon and have inserted mobile ad revenue.
I am just asking how to a script a button I have created so that it shows a player an ad and gives them a certain value of cash (I guess 5000) when clicked
I looked on YouTube and couldn't find any with the same problem, but the roblox wiki states that this is possible, but doesn't show how.
I hope you have time to respond
Report Abuse
LegitFake is not online. LegitFake
Joined: 03 Mar 2014
Total Posts: 81
07 Aug 2015 07:17 PM
need more detail to help you out
Report Abuse
darkside891 is not online. darkside891
Joined: 24 Jul 2013
Total Posts: 11
07 Aug 2015 07:57 PM
Basically you insert this script in the starter gui or starter pack and it makes an ad play when a player joins the game (only for roblox mobile) game:GetService("AdService"):ShowVideoAd()

game:GetService("AdService").VideoAdClosed:connect(function()
print("Finished showing video ad.")
end)
I am trying to make a button that gives 5000 cash (cash is my games currency) when it is pushed, but the ad has to be played.
More info on this can be found at http://wiki.roblox.com/?title=Mobile_Video_Ads
I really tried but I always fail so I came to the forum for help.
Report Abuse
zitwartfart5005 is not online. zitwartfart5005
Joined: 12 Jun 2010
Total Posts: 1
07 Aug 2015 08:00 PM
I don't know Roblox syntax, but you probably need to have it be that if the ad doesn't load it closes immediately, and if the ad screen is open for more than 10 seconds, then the ad had to have loaded by then. It's not perfect, but that's my thoughts.
Report Abuse
Blues714 is not online. Blues714
Joined: 23 Dec 2008
Total Posts: 6507
07 Aug 2015 08:03 PM
Never worked with this AdService but I'll see what I can do.

debounce = false
script.Parent.BUTTONNAME.MouseButton1Down:connect(function()
if debounce == false then debounce = true
game:GetService("AdService").VideoAdClosed:connect(function()
-- script here
end)
end)

--

Create an algorithm that gives the player cash, in place of the "script here"
Report Abuse
Blues714 is not online. Blues714
Joined: 23 Dec 2008
Total Posts: 6507
07 Aug 2015 08:04 PM
Oops! I forgot to set debounce to false!!

debounce = false
script.Parent.BUTTONNAME.MouseButton1Down:connect(function()
if debounce == false then debounce = true
game:GetService("AdService").VideoAdClosed:connect(function()
-- script here
end)
end)
debounce = false
Report Abuse
darkside891 is not online. darkside891
Joined: 24 Jul 2013
Total Posts: 11
07 Aug 2015 08:09 PM
Not at home right now, but I will make sure to try it when I get back and thanks for your help lol
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image