Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make the gui visible to a local player if the player has the gamepass?

Asked by 4 years ago

So I would like to make it so when any player joins if they have the gamepass the gui will be visible for them.

local gamepassId = 9555093 
local service = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(player)
        if (service:UserOwnsGamePassAsync(player, gamepassId)) then
        game.StarterGui.Skip1.TextButton.Visible = true


    end
end)

1 answer

Log in to vote
0
Answered by
6zk8 95
4 years ago
Edited 4 years ago
local gamepassId = 9555093 

local service = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(player)
        if service:UserOwnsGamePassAsync(player, gamepassId) then
        player.PlayerGui.Skip1.TextButton.Visible = true
  end
end)

Try this

You didn't use PlayerGui, only StarterGui

0
This did not work JuzeyPlayz -83 — 4y
0
try player:WaitForChild("PlayerGui").Skip1.TextButton.Visible = true jgftr7 74 — 4y
0
the gui dindt load in probaly jgftr7 74 — 4y
Ad

Answer this question