Hello..
I'm trying to make a GUI that only appears when the player in the game has a specific GamePass I have created. I inserted the script into ServerScriptService, and have the GUI's visibility off before the player joins the game.
The code I got in the output was: Expected identifier when parsing expression, got 'then'
Does anybody have a solution for this?
I'm a beginner at scripting, so here is my code:
local id = 11949150
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
if game:GetService("GamePassService"):PlayerHasPass(plr,id) then
plr.PlayerGui.YeetGui.YeetLabel.Visible = true
end
end)
end)

4 comments
Sorry but, I was getting an Error Message saying "UserOwnsGamepass is not a valid member of MarketplaceService". I was searching up all members of MarketPlaceService, but could'nt find anything that matches. I've got my script in ServerScriptService.
That's weird, try using my function I made and see if it works out for you.
Oh wow it worked when I used the whole script! The problem was that on line 12, "plr" is supposed to be "player" instead. Thanks!
Oh awesome!