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

Speed gamepass script?

Asked by
narfh 0
9 years ago

I have been trying to get this gamepass speed script working but I don't know how to fix it...

local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") 
Dark = game.Lighting.Darkheart
Scrpt = game.Lighting.S
sp = game.Workspace.SP

tw1 = 21054241
tw2 = 21054248
tw3 = 21054253
hp = 21054259
speed = 244125287
ff = 21054266
dh = 21054256
tp = 21054269
MarketplaceService.ProcessReceipt = function(receiptInfo)
    local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_product_" .. receiptInfo.ProductId
    local numberBought = ds:IncrementAsync(playerProductKey, 1)
    for i,v in pairs (game.Players:GetChildren()) do
        if v.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == tw1 then
                v.leaderstats.Cash.Value = v.leaderstats.Cash.Value + 25000
                elseif receiptInfo.ProductId == tw2 then
                v.leaderstats.Cash.Value = v.leaderstats.Cash.Value + 250000
            elseif receiptInfo.ProductId == tw3 then
                          v.leaderstats.Cash.Value = v.leaderstats.Cash.Value + 2500000
            elseif receiptInfo.ProductId == hp then
                v.Character.Humanoid.Health = v.Character.Humanoid.Health + 20
                v.Character.Humanoid.MaxHealth = v.Character.Humanoid.MaxHealth + 20
                wait()
                v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth
                        elseif receiptInfo.ProductId == speed then
                v.Character.Humanoid.WalkSpeed = v.Character.Humanoid.WalkSpeed + 45
                elseif receiptInfo.ProductId == ff then
                l = Instance.new("ForceField",v.Character)
                local pl = Scrpt:Clone()
                pl.Disabled = false
                pl.Parent = v.Character
                elseif receiptInfo.ProductId == dh then
                Dark:Clone().Parent = v.Backpack
                elseif receiptInfo.ProductId == tp then
                spawns = sp:GetChildren()
                m = spawns[math.random(1,#spawns)]
                wait()
                v.Character:MoveTo(m.Position)
                end 
            end
        end
    return Enum.ProductPurchaseDecision.PurchaseGranted 
end
3
Code block all of it. alphawolvess 1784 — 9y
0
Code block? narfh 0 — 9y
0
Edit your post and put the code between the ~~~~~~~'s created when you click the little blue Lua symbol. Perci1 4988 — 9y
0
http://gyazo.com/ed3d5bb3e4549874461cd253588534ac post your code between those '~' Senor_Chung 210 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Make sure you have the right codes for the Gamepass/group you are in.

Ad

Answer this question