So, i'm trying to make it so that If a player has a gamepass, a button(s) appears.
This gamepass gives you 1 weapon when bought:
local passid = 170543256 local GamePassService = Game:GetService('GamePassService') if GamePassService:PlayerHasPass(player, passid) then script.Parent.Parent.Parent.Parent.MainFrame.Row1.KNIFEGUN.Visible = true end
This gamepass gives you 2 weapons when bought:
local passid = 170544124 local GamePassService = Game:GetService('GamePassService') if GamePassService:PlayerHasPass(player, passid) then script.Parent.Parent.Parent.Parent.MainFrame.Row1.M37.Visible = true script.Parent.Parent.Parent.Parent.MainFrame.Row1.m.Visible = true end
This is not in a LocalScript.
Your issue is that "player" isn't defined, and there is no event that calls this.
local id = 170543256 local gps = game:GetService("GamePassService") game.Players.ChildAdded:connect(function(p) if gps:PlayerHasPass(p, id) then script.Parent.Parent.Parent.Parent.MainFrame.Row1.KNIFEGUN.Visible = true end end)