Hello! I’m trying to make a Gamepass which will give you 100 Coins so players can buy money… but it doesn’t seem to work… can someone help me?
local MarketplaceService = game:GetService("MarketplaceService")
local DataStoreService = game:GetService("DataStoreService")
local currencyName = "Money"
game.Players.PlayerAdded:Connect(function(plr)
if MarketplaceService:UserOwnsGamePassAsync(plr.UserId, 52622803) then
plr.leaderstats[currencyName].Value = plr.leaderstats[currencyName].Value + 100
end
end)
I think what your looking for is a DevProduct. This will make it so that players can buy money multiple times. Documentation: Developer Products – In‑Game Purchases
Also, I believe this doesn’t work because this only adds the coins when the player FIRST JOINS and not when he buys (if he own the game pass)