Hi, I keep getting an error as shown in the title whenever I show a GUI with this script in it to the player. How can I fix this?? Thank you
id = 6204
local passId = id
function isAuthenticated(player)
return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player, passId)
end
game.Players.PlayerAdded:connect(function(plr)
if isAuthenticated(plr) then
script.Parent.Parent:remove()
end
end)
The script is supposed to show a GUI where the user can click on it to buy a gamepass if they so wish.

4 comments
because 6204 isnt a valid gamepass id/ int64
and use :Destroy() instead of :Remove(), and Connect instead of connect
what is the point of setting an id variable, then setting the value of another variable to id?
6204 is a valid gamepass ID - I have taken into account your other points though