01 | script.Parent.Touched:connect( function (hit) |
02 |
03 | local player = game.Players.LocalPlayer |
04 | local character = player.Character |
05 |
06 |
07 |
08 | if hit.Parent then |
09 | local humanoid = hit.Parent:FindFirstChild( "Humanoid" ) |
10 | if humanoid then |
11 |
12 | if game:GetService( "GamePassService" ):PlayerHasPass(player, 1566809186 ) then |
13 |
14 | print "Teleporting" -- works only if player has game pass |
15 |
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.
1 | script.Parent.Touched:connect( function (hit) |
2 | local player = game.Players.LocalPlayer |
3 | if game:GetService( "GamePassService" ):PlayerHasPass(player, 1566809186 ) then |
4 | print ( "Teleporting" ) |
5 | else |
6 |
7 | game:GetService( "MarketplaceService" ):PromptPurchase(player, 16630147 ) |
8 | end |
9 | end ) |