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

Speed gamepass script?

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

4 comments

3

Code block all of it.

0

Code block?

0

Edit your post and put the code between the ~~~~~~~'s created when you click the little blue Lua symbol.

0

http://gyazo.com/ed3d5bb3e4549874461cd253588534ac post your code between those '~'

1 answer

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

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