I have a script that opens a door, (or turns cancollide off) (Edit: when the player has a gamepass..) but the script isn't working. Help!
local passId = 625504293 --change this to your GamePass Id
local marketplaceService = game:GetService("MarketplaceService")
local badgeID = 626563337 -- replace this with the badge's ID
local badgeID2 = 626586404
local badgeService = game:GetService("BadgeService")
marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased)
if isPurchased then --if the player did pay
if assetId == passId then --if what they bought is the pass
game.Workspace.PaidDoor.PIAS.CanCollide = false
local function onEntered(player)
wait(5)
if marketplaceService:PlayerOwnsAsset(player, passId) then
badgeService:AwardBadge(player.userId, badgeID, badgeID2)
if game.Workspace.PaidDoor.PIAS.CanCollide = false
then print("Okay Over Here")
end
end

1 comment
http://wiki.roblox.com/index.php?title=API:Class/GamePassService/PlayerHasPass