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

How do you make a gamepass give players a tool?

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.

2 comments

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.

0

I know. I was testing with that gamepass because I own that gamepass but not the Segway GamePass that is on the game.

1 answer

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

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