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

Gamepass GUI doesn't give sword?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago
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.)

0
":Clone" has to be uppercased? Pawsability 65 — 10y
0
Yes fireboltofdeath 635 — 10y
0
I'll give it a shot and see if it works. Pawsability 65 — 10y
0
:D I only spotted one, there may be more, sadly. Hope for the best fireboltofdeath 635 — 10y
View all comments (7 more)
0
Yeah, that didn't work. I really don't know why this isn't working. Pawsability 65 — 10y
0
Put in localscript of this new script I am putting fireboltofdeath 635 — 10y
0
It is a localscript. Pawsability 65 — 10y
0
Well try the new script anyways? fireboltofdeath 635 — 10y
0
Okay, I'll try that one. Pawsability 65 — 10y
0
Didn't work. Pawsability 65 — 10y
0
I don't get this, so confused. Pawsability 65 — 10y
Ad

Answer this question