script.Parent.Touched:connect(function(hit) local player = game.Players.LocalPlayer local character = player.Character if hit.Parent then local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then if game:GetService("GamePassService"):PlayerHasPass(player, 1566809186) then print "Teleporting" -- works only if player has game pass else game:GetService("MarketplaceService"):PromptPurchase(player, 16630147) end end end end)
I want to sell game pass to player if they dont have it but nothing happens. - Thanks
You have a lot of random rubbish here, lemme clean it up a lil bit.
script.Parent.Touched:connect(function(hit) local player = game.Players.LocalPlayer if game:GetService("GamePassService"):PlayerHasPass(player, 1566809186) then print("Teleporting") else game:GetService("MarketplaceService"):PromptPurchase(player, 16630147) end end)