So basically I want it to prompt a game pass purchase then simply change a value. When it prompts the game pass purchase it prompts some random game pass and does not work? Please help me, Here is the code!
local id = 5242880 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,id) then game.Workspace.Middle.Value = true else game:GetService("MarketplaceService"):PromptPurchase(player, id) script.Parent.Parent.Status.Text = "In order to be a Middle rank you need to buy the gamepass." wait(7) script.Parent.Parent.Status.Text = "" end end)
I have had problems in the past with local variables. Change local is to just id to make it global. They are actually faster because the script needs to read each letter 1 by 1 so it's slow for the script. Also try not to space out the code because it has to read the spaces making it even slower and harder for the script