Hi it’s me PeteHyper, I am wondering how do you make a hat Gamepass when a player buys the hat Gamepass, the hat will automatically be in a custom inventory ready to be equiped and can be unequipped be there every time a player joins. Please help? I’m not a great Scripter, just a very beginner Scripter?
COMMUNITY QUESTION
How do you make a hat Gamepass when player buys it, it will be in a custom inventory??
1 answer
local mps = game:GetService("MarketPlaceService") -- Gets marketplace service abbreviated
local player = game.Players.LocalPlayer --Gets localplayer abbreviated
if mps:UserOwnsGamePassAsync(player.UserId, gamepassid) then --checks if user has gamepass
player.Inventory.Gamepasshat.Value = true
end--ends script
kk so Idk how your inventory at all is set up so I would say make it so there are values that show if they own that hat or not and if the value == true then they get access to the hat if you need more info ask :)
accept if helps
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Soooo don’t you like need a hat game pass section where u can put it’s id and the hats name too?
And where does the script even goes?
Alright so so for my script where it shows player.UserId, gamepassid the gamepassid you would put the id of your gamepass
and you would make a localscript in starterplayerscripts and put that script in then you would make a datastore containing the hats