So, I have this script. When a button is clicked, it is supposed to...
- Change the status under the 'Your Answers' to 'Easy' (Which it does)
- Wait 6 seconds
- Show an ad (I'm assuming it automatically skips in desktop)
- For desktop users since it hasn't already been changed to the next frame, change it.
Number 1 works, but after that nothing else appears to work. Nothing is showing in the output, and the Script Analysis says its fine... so why doesn't it work? Here's the script.
wait(1)
player = game.Players.LocalPlayer
gui = player.PlayerGui.ScreenGui
adscreen = gui.adscreen
step2 = gui.Step2
loading = gui.loading
script.Parent.MouseButton1Down:connect(function()-- The script's parent is a TextButton entitled 'Easy'
adscreen.step2choice.Text = ("Easy")--There is a TextLabel in adscreen that is supposed to show your choice. This is changing the text to what you chose, which happens to be 'Easy'
step2.Visible = false--the Step2 Frame
adscreen.Visible = true--the adscreen Frame
wait(5)
game:GetService("AdService"):ShowVideoAd() --Supposed to show the ad
game:GetService("AdService").VideoAdClosed:connect(function()-- when ad is closed, should close adscreen and open loading, another Gui
adscreen.Visible = false
loading.Visible = true
if loading.Visible == false then
adscreen.Visible = false
loading.Visible = true
end
end)
end)
