Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by
Tixy12 0
10 years ago

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
Okay really. I'm reporting you as a spammer NovusTheory 133 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

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
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 NovusTheory 133 — 10y
Ad

Answer this question