Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local char = plr.Character or plr.CharacterAdded:Wait()
- local humanoid = char:WaitForChild("Humanoid")
- local mps = game:GetService("MarketplaceService")
- local gamepassID = 12178123
- local gamepassOwned = false
- pcall(function()
- gamepassOwned = mps:UserOwnsGamePassAsync(plr.UserId, gamepassID)
- end)
- if gamepassOwned == true then
- workspace.VIPDoor.Transparency = 0.5
- workspace.VIPDoor.CanCollide = false
- end
- humanoid.Touched:Connect(function(touchedPart)
- if gamepassOwned == true then return end
- if touchedPart == workspace.VIPDoor then
- mps:PromptGamePassPurchase(plr, gamepassID)
- end
- end)
- mps.PromptGamePassPurchaseFinished:Connect(function(playerPurchased, purchasedID, purchaseSuccess)
- if not purchaseSuccess then return end
- if playerPurchased == plr and purchasedID == gamepassID then
- gamepassOwned = true
- workspace.VIPDoor.Transparency = 0.5
- workspace.VIPDoor.CanCollide = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement