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 hat Gamepass when player buys it, it will be in a custom inventory??

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?

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

4 comments

0

Soooo don’t you like need a hat game pass section where u can put it’s id and the hats name too?

0

And where does the script even goes?

0

Alright so so for my script where it shows player.UserId, gamepassid the gamepassid you would put the id of your gamepass

0

and you would make a localscript in starterplayerscripts and put that script in then you would make a datastore containing the hats

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