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)

3 comments
PlayerAdded doesn't work in localscripts. I'll help you later if no-one made an answer.
:l Ok
You could use ChildAdded on game.players. I can't make you the script right now though. Try seeing if you can make the script with childadded.