Infinite Cash Gamepass

As @HugeCoolboy2007 said, you would need to add the event that checks when the player buys it. I added that later, otherwise it would only give the money to the user after they rejoin.

You should keep the current code for when a player that already bought the gamepass rejoins, then add this code

local MarketplaceService = game:GetService("MarketplaceService")

local function gamepassPurchaseFinished(...)
	-- give player money
end
 
MarketplaceService.PromptGamePassPurchaseFinished:Connect(gamepassPurchaseFinished)

I tried this but its not working

local MarketplaceService = game:GetService("MarketplaceService")
local function gamepassPurchaseFinished(...)
local Stats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
Stats.Value = 99000000
end

MarketplaceService.PromptGamePassPurchaseFinished:Connect(gamepassPurchaseFinished)