Teleport to different place on brick touch and has gamepass?
Asked by
8 years ago Edited 8 years ago
In my game, I am trying to make a 'VIP Door' which will need the player to buy a gamepass so they can teleport to another place. I have put the place in 'Other Places' on the roblox website and put the following code in a script inside the 'Door':
01 | local passId = 622740681 |
02 | local marketplaceService = game:GetService( "MarketplaceService" ) |
04 | function onTouched(hit) |
05 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
07 | marketplaceService.PromptPurchaseFinished:connect( function (player,assetId,isPurchased) |
09 | if assetId = = passId then |
10 | game.GetService( "TeleportService" ):Teleport( 623097807 , player) |
16 | script.Parent.Touched:connect(onTouched) |
If you can see, I used some help from the roblox wiki, but I can't get it to work.