Basically, this script should prompt you if you don't own a game pass id and if you do it will change a value in workspace. Unsure what this error means? Here is the code:
local id = 5242880 local UserId = game.Players.LocalPlayer.UserId script.Parent.MouseButton1Click:Connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(UserId, id) script.Parent.Parent.Status.Text = "In order to be a Middle rank you need to buy the gamepass." if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(UserId,id) then game.Workspace.Middle.Value = true else wait(7) script.Parent.Parent.Status.Text = "" end end)
PromptGamePassPurchase requires a Player as its first argument, as you can see here - PromptGamePassPurchase on the wiki, and checking the UserOwnsGamePassAsync should be done on the server