So I was recently making a tycoon where you can buy weapons, build a house, and fight people. I have already made some game passes for extra speed and health. I tried to make a game pass that you could buy for x2 cash, but I failed. I hope we can figure this out.
You would make a gamepass, and use the ID to see if the any user has it. When any money is given to them, check to see if they have it. If they do, double the amount given, or else keep it the same.
local cashmulti = game.MarketplaceService:UserOwnsGamePassAsync(player, 1234) and 2 or 1
cash.Value += amount * cashmulti
local marketplace = game:GetService(“MarketplaceService”)
local gamepassId = the id would go here
game.Players.PlayerAdded:connect(function(player)
wait(2)
local success, result = pcall(function()
return marketplace:UserOwnsGamePassAsync(player.UserId, gamepassId)
end)
So when a player joins, the game checks to see if they own the gamepass
Now giving the cash
if success then
if result then
player.stats.Cash.Value ect ect What happens if they do own it
else
player.stats.Cash.Value ect ect What happens if they dont
end