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

Gamepass GUI doesn't give sword?

This doesn't seem to work. I've changed so many things, and it still doesn't work. I've spent hours on this. Can anyone help me find out what's wrong?

ID = 162597573
GPS = game:GetService("MarketplaceService")
player = script.Parent.Parent.Parent.Parent.Parent

function Buy()
	game:GetService("MarketplaceService"):PromptPurchase(player,ID)
	GPS.PromptPurchaseFinished:connect(function(player, ID, isPurchased)
		if isPurchased then
			clone1 = game.ServerStorage["Dual Darkheart"]:clone()
			clone1.Parent = player.Backpack
		end
	end)
end

script.Parent.MouseButton1Click:connect(Buy)

1 answer

local passid = 000000000 -- Gamepass ID --
local tools = {""} -- Tool names EXACTLY, make sure the tools are in Lighting --
local GamePassService = Game:GetService('GamePassService')
game.Players.PlayerAdded:connect(function(player)
repeat wait(0) until player.Backpack	
repeat wait(0) until player.StarterGear
if GamePassService:PlayerHasPass(player, passid) then
for i = 1,#tools do
game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack
game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear
end
end
end)

Try that? You have to set it up (For in-game purchase) (Put tools in lighting.)

11 comments

0

":Clone" has to be uppercased?

0

Yes

0

I'll give it a shot and see if it works.

0

:D I only spotted one, there may be more, sadly. Hope for the best

0

Yeah, that didn't work. I really don't know why this isn't working.

0

Put in localscript of this new script I am putting

0

It is a localscript.

0

Well try the new script anyways?

0

Okay, I'll try that one.

0

Didn't work.

0

I don't get this, so confused.

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