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 » Scripters
Home Search
 

Re: Mobile ads aren't working

Previous Thread :: Next Thread 
woutje is not online. woutje
Joined: 22 Feb 2009
Total Posts: 13
08 Nov 2015 04:31 AM
I tried the following LocalScript by placing it in StarterGUI: http://pastebin.com/iqEpQ9HG
And the following Script in Workspace: http://pastebin.com/p5yDc99P
But it isn't showing a button on a mobile.
How can I get it to work?
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
08 Nov 2015 04:55 AM
good
Report Abuse
woutje is not online. woutje
Joined: 22 Feb 2009
Total Posts: 13
08 Nov 2015 05:31 AM
Why did you say "good"?

Can please someone help me???
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
08 Nov 2015 05:37 AM
localscript fixed

S = game:GetService("UserInputService")
local fix = game.Players.LocalPlayer.MembershipType

if S.GamepadEnabled then
game:GetService("AdService").VideoAdClosed:connect(function(shown)
if fix ~= 0 then
game.ReplicatedStorage.ForceFieldEvent:FireServer(false)
end
end)

local function playAd()
game.ReplicatedStorage.ForceFieldEvent:FireServer(true)

if fix ~= 0 then
game:GetService("AdService"):ShowVideoAd()
end
end

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 200)
textButton.Size = UDim2.new(0, 125, 0, 25)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "View an ad to get $500!"
textButton.MouseButton1Down:connect(function()
textButton:remove()
playAd()
end)
end
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
08 Nov 2015 05:39 AM
fixed*

S = game:GetService("UserInputService")
local fix = game.Players.LocalPlayer.MembershipType

if S.GamepadEnabled then
game:GetService("AdService").VideoAdClosed:connect(function(shown)
if fix == Enum.MembershipType.None then
game.ReplicatedStorage.ForceFieldEvent:FireServer(false)
end
end)

local function playAd()
game.ReplicatedStorage.ForceFieldEvent:FireServer(true)

if fix == Enum.MembershipType.None then
game:GetService("AdService"):ShowVideoAd()
end
end

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 200)
textButton.Size = UDim2.new(0, 125, 0, 25)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "View an ad to get $500!"
textButton.MouseButton1Down:connect(function()
textButton:remove()
playAd()
end)
end
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
08 Nov 2015 05:41 AM
ok now its really fixed

S = game:GetService("UserInputService")
local fix = game.Players.LocalPlayer.MembershipType

if S.GamepadEnabled then
game:GetService("AdService").VideoAdClosed:connect(function(shown)
if fix == Enum.MembershipType.None then
game.ReplicatedStorage.ForceFieldEvent:FireServer(false)
end
end)

local function playAd()
game.ReplicatedStorage.ForceFieldEvent:FireServer(true)

if fix ~= Enum.MembershipType.None then
game:GetService("AdService"):ShowVideoAd()
else
game.ReplicatedStorage.ForceFieldEvent:FireServer(false)
end
end

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 200)
textButton.Size = UDim2.new(0, 125, 0, 25)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "View an ad to get $500!"
textButton.MouseButton1Down:connect(function()
textButton:remove()
playAd()
end)
end
Report Abuse
woutje is not online. woutje
Joined: 22 Feb 2009
Total Posts: 13
08 Nov 2015 06:05 AM
I still don't see the "View an ad to get $500 button"
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
08 Nov 2015 06:14 AM
S = game:GetService("UserInputService")
local fix = game.Players.LocalPlayer.MembershipType

if S.GamepadEnabled then
game:GetService("AdService").VideoAdClosed:connect(function(shown)
if fix == Enum.MembershipType.None then
game.ReplicatedStorage.ForceFieldEvent:FireServer(false)
end
end)

local function playAd()
game.ReplicatedStorage.ForceFieldEvent:FireServer(true)

if fix ~= Enum.MembershipType.None then
game:GetService("AdService"):ShowVideoAd()
else
game.ReplicatedStorage.ForceFieldEvent:FireServer(false)
end
end

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 200)
textButton.Size = UDim2.new(0, 125, 0, 25)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "View an ad to get $500!"
textButton.MouseButton1Down:connect(function()
textButton:remove()
playAd()
end)
end
Report Abuse
woutje is not online. woutje
Joined: 22 Feb 2009
Total Posts: 13
08 Nov 2015 06:32 AM
The button is still not showing :-(
Report Abuse
SectionOne is not online. SectionOne
Joined: 12 Mar 2010
Total Posts: 3783
08 Nov 2015 06:44 AM
You should just troll the premium people and make it play ads only for them xD
Report Abuse
woutje is not online. woutje
Joined: 22 Feb 2009
Total Posts: 13
08 Nov 2015 06:58 AM
Hahaha! But seriously, how do I get it working???
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
08 Nov 2015 07:08 AM
mobile ads only show for people over 13 due to issues with the ad provider

or when roblox have a deal with another business for ads

-LOL!
Report Abuse
woutje is not online. woutje
Joined: 22 Feb 2009
Total Posts: 13
08 Nov 2015 07:13 AM
But I am over 13!
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
08 Nov 2015 07:34 AM
its because your script requires a gamepad to be connected

adding this line to the top of the script will fix it
while 1 do end
Report Abuse
woutje is not online. woutje
Joined: 22 Feb 2009
Total Posts: 13
08 Nov 2015 09:18 AM
No, that's for checking if it's a mobile device as suggested on the Roblox Forum.
Report Abuse
woutje is not online. woutje
Joined: 22 Feb 2009
Total Posts: 13
08 Nov 2015 09:32 AM
Oh I found the solution: instead of `if S.GamepadEnabled then` doing `if S.KeyboardEnabled == false then`
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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