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

How can I make gamepasses work these days?

Asked by 6 years ago

ROBLOX has changed the IDs of gamepasses, and it's been driving me crazy. I've tried making them work with MarketplaceService, and GamePassService, and nothing works. Here's the script i have right now:

    local Tools = script.Items:GetChildren()
    local GamepassID = script.Configuration.GamepassID.Value

    function GiveTools(Player)
        wait(0.5)
        if game:GetService("GamePassService"):PlayerHasPass(Player, GamepassID) then
             for _,Tool in pairs(Tools) do
                local NewTool1 = Tool:Clone()
                NewTool1.Parent = Player.Backpack
                local NewTool2 = Tool:Clone()
                NewTool2.Parent = Player.StarterGear
            end
        end
    end

    game:GetService("Players").PlayerAdded:connect(GiveTools)
Can anyone help?
0
You're not specifying the player are you? TheePBHST 154 — 6y
0
@TheePBHST op connected the function to game.Players.PlayerAdded which will return a player argument, so the player argument in the function will be set to the player argument that game.Players.PlayerAdded returned Rare_tendo 3000 — 6y

Answer this question