I made this script that is supposed to make a gui visible to a player whom owns the gamepass.
local id = 3484579 game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) if game:GetService('GamePassService'):PlayerHasPass(plr,id)then plr.PlayerGui.GamepassShop.Frame.Visible = true end end)?
Line 3 makes sure the gui pops up when the player joins the game and Line 4 makes sure the gui stays visible after the player resets. Also the gamepass ID is valid and the game is published, so that shouldn't be causing the issue. Also the script is in ServerScriptService.
You seem to be missing an end statement for your CharacterAdded function. I'm surprised you didn't get any errors for that.
Here's what your code should look like:
local id = 3484579 game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) if game:GetService('GamePassService'):PlayerHasPass(plr,id) then plr.PlayerGui.GamepassShop.Frame.Visible = true end end) end)
As others have said, :connect is deprecated, but I don't think using it will break a script entirely. Still, it's good practice to use :Connect.