Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

3 comments

0

This did not work

0

try player:WaitForChild("PlayerGui").Skip1.TextButton.Visible = true

0

the gui dindt load in probaly

This discussion is preserved as it was. New answers, comments, and votes are closed.