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

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

Asked by 3 years ago
Edited 3 years ago

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)*

0
Place It In A Code Block please kidsteve923 139 — 3y
0
can you update it with all of the code? i think you did the gamepass wrong LatvianMinecraftorLv 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
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,

Ad

Answer this question