Supposed to check if you own a gamepass and if you do, you get teleported somwhere, if you don't, it prompts you to buy it.
Currently doesn't work and it shows the wrong gamepass when i'm asked to buy
script.Parent.ClickDetector.MouseClick:connect(function(player) local hasPass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId, 3369333) if hasPass ~= true then game:GetService("MarketplaceService"):PromptPurchase(player, 3369333) end if hasPass == true then player.Humanoid.Torso.CFrame = workspace.TPHERE.CFrame print("XD") end end)
Change the numbers in line 4 and 8 to the gamepass id. And line 13 should be player.Character.HumanoidRootPart.Position = workspace.TPHERE.Position
That’s it. Should work. If anything wrong feel free to reply.
script.Parent.ClickDetector.MouseClick:connect(function(player) local hasPass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId, 3369333) if hasPass ~= true then game:GetService("MarketplaceService"):PromptPurchase(player, 3369333) else player.Character.HumanoidRootPart.CFrame = CFrame.new(workspace.TPHERE.Position) print("XD") end end)
checks if they got the gamepass, if they do then they will get teleported to TPHERE position, else they will get prompted to buy it