Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is this the right script for unlimited money with math.huge?

Okay. I am trying to make to give players who own my gamepass Unlimited money, someone recommended math.huge but is this the right script?

local player = nil--Provide the player I think
local MS = game:GetService("MarketplaceService")

local Gamepass Id = 0
MS:PromptProductPurchase(player,Id)
MS.ProcessReceipt = function(receiptInfo) 
if Enum.ProductPurchaseDecision.PurchaseGranted and recieptInfo.PlayerId

== Player.userId then 
	= Player.leaderstats.Cash.Value Player.leaderstats.Cash.Value + math.huge
end 

2 comments

1

Why don't you just have a stringvalue as the cash and make it say "Unlimited"... then in a script check if it says that and make sure they get all items for free..?

0

^Do this.

1 answer

✓ Accepted answer

There was a typo on

if Enum.ProductPurchaseDecision.PurchaseGranted and recieptInfo.PlayerId==player.userId then

receiptInfo was accidentally spelt recieptInfo (Letter I before Letter E)

if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId==player.userId then

This is the part without the typo.

(Hoped this helped!)

This discussion is preserved as it was. New answers, comments, and votes are closed.