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

How do you make a gamepass give players a tool?

Asked by 4 years ago

So, I have a gamepass for a segway and I have the tool. I tried creating a script so when the player joins, if they have the specified gamepass then they will be given the segway. This is what I tried:

local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassId = 6547079

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function()
        if MarketPlaceService:UserOwnsGamePassAsync(player.userId, GamepassId) then
            script.HandlessSegway:Clone().Parent = player.Backpack
        end
    end)
end)

However, during testing this did not work.

0
It seems like you're using the wrong gamepass ID. I found a gamepass on Roblox (https://www.roblox.com/game-pass/6547079/56-Off-Premium) that shares the same ID, but it has nothing to do with a segway. y3_th 176 — 4y
0
I know. I was testing with that gamepass because I own that gamepass but not the Segway GamePass that is on the game. Diamond9195 45 — 4y

1 answer

Log in to vote
0
Answered by
Maxis_s 97
4 years ago

The gamepass has to be on your own game, I believe.

Try making a gamepass, you'll automatically own it if you made it.

If this doesn't work, let me know.

Hope this helps!

-Maxis_s

Ad

Answer this question