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

How do you make a Dev Product reward speed when you buy it?

Well hello guys I need help with this so I can makes perks for my game. I have a script that adds speed and when you die it goes away which is good but then when they rejoin they have all that speed back which I do not like it. I want it to were when you buy it the product and you die you lose it forever until you buy it again.

This is not a request you don't have to help but thanks if you do! :)

The script I have in the script to add the speed:

local developerProduct = 20433249 -- Id of the developer product local speedInc = 15 --Change this to the amount of Walkspeed you'd like to give.

Game:GetService("MarketplaceService").ProcessReceipt = function(receipt)
    if receipt.ProductId == developerProduct then -- the speed dev product
        for i,v in pairs(game.Players:GetPlayers()) do -- loop through the players
            
			if v.userId == receipt.PlayerId then -- if they're the player that bought it
                if v.Character and v.Character:FindFirstChild("Humanoid") then
                    v.Character.Humanoid.WalkSpeed = v.Character.Humanoid.WalkSpeed + speedInc -- add speedinc to their current walkspeed
                end
            end
        end
    end
end

1 comment

1

Okay really. I'm reporting you as a spammer

1 answer

You could use a BoolValue for each player showing whether they have purchased the Developer Product. Check the BoolValue every time the player respawns. If the BoolValue is true, give the speed boost.

1 comment

1

He doesn't understand this concept, I told him numerous times to have a bool value and he's being greedy for a script. He is also confused with everything

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