Hey, I've been trying to work on this for the past half hour to try and get this to work, it always just comes up with the Infinite Yield possible on PlayerGui. (This is a script in workspace, maybe that's the issue?)
local id = 1115304569
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:Connect(function(character)
if game:GetService("GamePassService"):PlayerHasPass(player, id) then
player.PlayerGui:WaitForChild("MainGui").Frame.Classes.ChooseWeapon.Frame.Visible = true
else
player.PlayerGui:WaitForChild("MainGui").Frame.Classes.ChooseWeapon.Frame.Visible = false
end
end)
end)

6 comments
make sure the maingui exists in the player?, you could try and print every object in the player gui
FE blocks the server from seeing the PlayerGui. If it is on, use a remoteevent to change these
I would probably advise you making this a localscript and putting it in StarterPlayerScripts
If you're opening/closing things whenever they spawn.. why not just have them already visible/not visible in the StarterGui?
https://pastebin.com/UZZsV8xZ
stop making me linking that