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.
Lua is a hierarchy language. Your variables are not assigned correctly so the computer does not know what to cast to. Rearrange your variables so that the variables are executed first then the functions/events.