local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local GamepassIds = require(game.ReplicatedStorage.Configuration.Modules.Gamepasses)
local ID = 1382081575
Players.PlayerAdded:Connect(function(player)
local Configuration = player:WaitForChild("Configuration")
local SpeedBoost = Configuration:WaitForChild("SpeedBoostGamepass")
local function CheckGamepass()
print("check gamepass")
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID) then
print("Gamepass active!")
SpeedBoost.Value = true
end
end
CheckGamepass()
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr, gamePassId, wasPurchased)
if plr == player and wasPurchased and gamePassId == ID then
print("PURCHASE")
CheckGamepass()
end
end)
end)
Hi,
For some unknown reason, the gamepass isn’t activated when I buy the gamepass, even though the id is the same.
Thanks in advance!