Im trying to create a script which only makes a screengui button selectable if a certain gamepass is owned, I watched a youtube tutorial to which nearly every comment claims 'It doesn't work'.

So I have this script in ServerScriptStorage

local id = 11543684

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(plr)
		if game:GetService('GamePassService'):PlayerHasPass(plr,id) then
			plr.PlayerGui.SideButtons.Main.Buttons.Test1.Selectable= true
		end
	end)
end)

but it doesn't work. I have asked the only two experienced LUA scripters I know and they are clueless when it comes to gamepass and monetization, is anyone able to see a reason as to why this doesn't work? If so can you help me?

1 comment

0

try using plr.UserId