I am trying to get a button to show if a player has the gamepass but it's not working.
local id = 1308026475 game.Players.PlayerAdded:connect(function(player) if game:GetService("GamePassService"):PlayerHasPass(player, id) then script.Parent.Visible = true end end)
Please help! Thanks in advance.
Use a script instead of a localscript if your using a local script.
Make sure it's in a server script like FireyMcBlox said. If it is, I suggest adding to the script a bit.
local id = 1308026475 game.Players.PlayerAdded:connect(function(player) if game:GetService("GamePassService"):PlayerHasPass(player, id) then script.Parent.Visible = true else script.Parent.Visible = false end end)