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

Im not really sure why it doesnt give me the coil? Please help!

Heres the code

*local Players = game:GetChildren("Players")

local MarketplaceService = game:GetService("MarketplaceService") local id = 19300147

game.Players.PlayerAdded:Connect(function(player) local OwnsPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, id) if OwnsPass then local SpeedC = game.ReplicatedStorage["Speed Coil"]:Clone() SpeedC.Parent = player.Backpack end end)

local function onPromptGamePassPurchaseFinished(player, purchasedPassID, purchaseSucces) if purchaseSucces == true and purchasedPassID == id then print(player.Name .. "Purchasted Speed Coil BABBY")

	local SpeedC = game.ReplicatedStorage["Speed Coil"]:Clone()
	SpeedC.Parent = player.Backpack
	
end

end

MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished)*

2 comments

0

Place It In A Code Block please

0

can you update it with all of the code? i think you did the gamepass wrong

1 answer

local marketplaceService = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(plr)
	
	wait(1)
	
	local owns = marketplaceService:UserOwnsGamePassAsync(plr.UserId,19300147)
	
	if owns == true then
		local clone = game.ReplicatedStorage.SpeedCoil:Clone()
		clone.Parent = game.Players[plr.Name].Backpack
	end
end)

Try this instead,

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