I Have A Simulator Game Where You Collect Coins And Sell Them For Cash, Currently, I Am Trying To Make A Double Points Gamepass. I Have Very Limited Knowledge With Roblox Lua And Money Systems So Please Excuse My Mistakes.
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, id) game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id) if player then local leaderstats = player:WaitForChild("leaderstats") local Currency = leaderstats.Money -- Change Money To your currency local Selling = leaderstats.Coins -- Change Grass to what you selling. if Selling.Value > 0 then Currency.Value = Currency.Value + Selling.Value *1.5 -- This 1 means multiple you can change it to whatever you want Selling.Value = 0 end end end end)
local owns = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id)
Make that into a variable, it will return true or false depending if the User owns the game pass.
local CurrentMultiplier = 1 if owns then CurrentMultiplier = 2 end if player then local leaderstats = player:WaitForChild("leaderstats") local Currency = leaderstats.Money local Selling = leaderstats.Coins if Selling.Value > 0 then Currency.Value = Currency.Value + Selling.Value *1.5 * CurrentMultiplier Selling.Value = 0 end end end end)
If the player owns the gamePass, then his Current Multiplier will raise by 2X.