I put this LocalScript into Startergui. Basically, I want a TextButton to be visible when a Player owns a Gamepass.
game.Players.PlayerAdded:connect(function(plr) if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,205849491) then script.Parent["Change Team GUI"].SwitchTeam.Judge.Visible = true else script.Parent["Change Team GUI"].SwitchTeam.Judge.Visible = false end end)
Thetacah answered this question, though he had no time to make an example script.
A working script:
local Judge=script.Parent["Change Team GUI"].SwitchTeam.Judge;--// Simplified. game:service'Players'.childAdded:connect(function(Player) if( Player:isA'Player'and game:GetService("MarketplaceService"):PlayerOwnsAsset( Player, 205849491 ) ) then Judge.Visible = true else Judge.Visible = false end end);