I have a VIP door with a gamepass. I would like to know how I can make that door detect if a player does not have the gamepass and pop up a GUI to buy the pass.
Thank you!
I have a VIP door with a gamepass. I would like to know how I can make that door detect if a player does not have the gamepass and pop up a GUI to buy the pass.
Thank you!
Here you go. Simple events and methods.
id = 1337 -- gamepass id
script.Parent.Touched:connect(function(hit)
if hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) then
p = game.Players:GetPlayerFromCharacter(hit.Parent)
if game:GetService("GamePassService"):PlayerHasPass(p, id) then
script.Parent.CanCollide = false
script.Parent.Transparency = 0.7
wait(0.2)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
else
game:GetService("MarketplaceService"):PromptPurchase(p,id)
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.