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.