advertising gamepasses through this gui selector in my game
but I want to make it so if people have a gamepass it doesn't show them the gui
how do I fix this script?
local passid = 73###########l######a############### game:GetService('GamePassService')
game.Players.PlayerAdded:connect(function(player)
if GamePassService:PlayerHasPass(player, passid) then
print("avoid ads")
else
while wait(10) do
x = math.random(1, 6)
if (x == 1) then
script.Parent.ad1.Visible = true
wait(29)
script.Parent.ad1.Visible = false
wait(1)
elseif (x == 2) then
script.Parent.ad2.Visible = true
wait(29)
script.Parent.ad2.Visible = false
wait(1)
elseif (x == 3) then
script.Parent.ad3.Visible = true
wait(29)
script.Parent.ad3.Visible = false
wait(1)
elseif (x == 4) then
script.Parent.ad4.Visible = true
wait(29)
script.Parent.ad4.Visible = false
wait(1)
elseif (x == 5) then
script.Parent.ad5.Visible = true
wait(29)
script.Parent.ad5.Visible = false
wait(1)
elseif (x == 6) then
script.Parent.ad6.Visible = true
wait(29)
script.Parent.ad6.Visible = false
wait(1)
end
end
end
end)
|