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 |
|
|
| |
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 22 Feb 2009 |
| Total Posts: 13 |
|
|
| 08 Nov 2015 06:32 AM |
| The button is still not showing :-( |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 22 Feb 2009 |
| Total Posts: 13 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|