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
Make sure you have the right codes for the Gamepass/group you are in.