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

How do you make a hat Gamepass when player buys it, it will be in a custom inventory?? [closed]

Asked by 3 years ago

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?

Closed as Not Constructive by Leamir

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 3 years ago
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

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