|
|
I haven't learned how to work with gamepasses yet, but search up "gamepasses roblox" on Google and click the Wiki link.
The examples look easy and straightforward |
|
|
Generally, you have to rejoin the game in order for game passes to work
However, you can implement a function that detects if the player purchased the game pass, and then you can "unlock" the door from that moment, otherwise the default "check for game pass" won't work until they rejoin |
|
|
local gamepassid =
local char = hit.Parent
local player = game.Players:GetPlayerFromCharacter(char)
if game:GetService("GamePassService"):PlayerHasPass(player, gamepassid) then
--CODE HERE!!
end
end) |
|
|
Thats the default script im talking about, but when you prompt purchase to the player, there is a variable to check to see if it has been purchased |
|
|
my bad, incase they DONT own the pass, you can tease them to buy it.
id = 12345
game.Players.PlayerAdded:connect(function(player)
game:GetService("MarketplaceService"):PromptPurchase(player, id)
end) |
|
|
Again, i assume he already has that - are you reading anything im saying?
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.PromptPurchaseFinished:connect(function(player, assetId, isPurchased)
if isPurchased then
print(player.Name .. " bought an item with AssetID: " .. assetId)
else
print(player.Name .. " didn't buy an item with AssetID: " .. assetId)
end
end)
Use this to open the door straight away, after the the gamepass has been purchased |
|
|
i didnt understand what you were saying rather than not putting it into code.. |
|
|
|
|
|
There might be a problem with who's selling the game pass and who owns it |
|
|
|
l
r+://334118955r+://334119003r+://334119053 my total postcount is 23k since 6/20/17 |
|
|