I’ve already made the full GUI needed to purchase my gamepasses, and it prompts the purchase, but how do I make them give the gear?
I’ve added the two gear (boombox and gravity coil) to the replicated storage and now I’m wondering how to make the purchase give these items after rejoining.
local mps = game:GetService("MarketplaceService")
local gamepass_id = 0 --63172916
local plrs = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(player)
if mps:UserOwnsGamePassAsync(player.UserId , gamepass_id) then
game.ServerStorage.ToolExample:Clone().Parent = player.Backpack
game.ServerStorage.ToolExample:Clone().Parent = player.StarterGear
end
end)
But I have multiple gear gamepasses, how will I differentiate between the two?
You’d make an if statement for each and add them accordingly. But it would be a bit easier to have a list of them with predefined Ids and items and all that.
you can use this to see when a gamepass is actually purchased in game
if they purchased it out of game you will want to do something like above to award it
could even use this in combination and just call a function to give the reward