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

Dev Products are driving me crazy qq. help?

I have no clue where is going wrong


local speedUpgradeId1 = 20996735
local speedUpgradeId2 = 20984745
local speedUpgradeId3 = 20984749
local speedUpgradeId4 = 20984753
local speedUpgradeId5 = 20984757
local speedUpgradeId6 = 20984761
local speedUpgradeId7 = 20984769

local healthUpgradeId = 20984772
local healthUpgradeId2 = 20996932
local healthUpgradeId3 = 20984771

local mpService = game:GetService("MarketplaceService")

mpService .PromptProductPurchaseFinished:connect(function(plr, assetId, isPurchased)
    if isPurchased and plr.Character then
	
        if assetId == speedUpgradeId1 then
            plr.Character.Humanoid.Walkspeed = plr.Character.Humanoid.Walkspeed + 2


        elseif assetId == speedUpgradeId2 then
            plr.Character.Humanoid.Walkspeed = plr.Character.Humanoid.Walkspeed + 5


		elseif assetId == speedUpgradeId3 then
            plr.Character.Humanoid.Walkspeed = plr.Character.Humanoid.Walkspeed + 10

        elseif assetId == speedUpgradeId14 then
            plr.Character.Humanoid.Walkspeed = plr.Character.Humanoid.Walkspeed + 20


		elseif assetId == speedUpgradeId5 then
            plr.Character.Humanoid.Walkspeed = plr.Character.Humanoid.Walkspeed + 30


        elseif assetId == speedUpgradeId6 then
            plr.Character.Humanoid.Walkspeed = plr.Character.Humanoid.Walkspeed + 50


		elseif assetId == speedUpgradeId7 then
            plr.Character.Humanoid.Walkspeed = plr.Character.Humanoid.Walkspeed + 120


		elseif assetId == healthUpgradeId then
            plr.Character.Humanoid.MaxHealth = plr.Character.Humanoid.MaxHealth + 100
			plr.Character.Humanoid.Health = plr.Character.Humanoid.MaxHealth


        elseif assetId == healthUpgradeId2 then
            plr.Character.Humanoid.MaxHealth = plr.Character.Humanoid.MaxHealth + 250
			plr.Character.Humanoid.Health = plr.Character.Humanoid.MaxHealth


        elseif assetId == healthUpgradeId3 then
            plr.Character.Humanoid.MaxHealth = plr.Character.Humanoid.MaxHealth + 5000
			plr.Character.Humanoid.Health = plr.Character.Humanoid.MaxHealth


        end
    end
end)

2 comments

1

Perhaps the space between mpService and .PromptProductPurchaseFinshed? Also, PromptProductPurchaseFinished is deprecated.

0

What does deprecated mean?

1 answer

PromptProductPurchaseFinished is deprecated. Deprecated is used typically in reference to a computer language to mean a command or statement in the language that is going to be made invalid or obsolete in future versions. In basic terms it means that it is no longer going to be used. ~PromptProductPurchaseFinished - Wiki ROBLOX

Also, there is a typo on line 15 with a space.

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