I’m gonna make a gamepass like if you buy it you will have instantly one hat like a green top hat or i make another gamepass and i got another hat?
Someone can help me?
I’m gonna make a gamepass like if you buy it you will have instantly one hat like a green top hat or i make another gamepass and i got another hat?
Someone can help me?
ok i will try
There are several ways to do this
The first one is easiest and capable of being done with free models, although you shouldn’t use them and instead try to figure out how they work and why they work by looking at what apis they are calling and what methods are being used.
The second one is more complex but is more worth learning so that you can do other more fun things with guis
No, I do not want to make a vip room, I want to make a gamepass that gives you a hat, like the example 2 that you have given of the gui.
Use PromptGamePassPurchaseFinished, and UserOwnsGamePassAsync for new players.
e.g.
local MarketplaceService = game:GetService('MarketplaceService')
local GAMEPASSID = 000000
local function AddHatToCharacter(Character)
-- Run code to add hat.
script:FindFirstChildOfClass('Accessory'):Clone().Parent = Character
end
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(Player, GamePassId, Purchased)
if Purchased then -- They actually bought it, and didn't click 'Cancel'
if GamePassId == GAMEPASSID then -- It's the hat gamepass
Player.CharacterAdded:Connect(function(Character)
AddHatToCharacter(Character)
end)
if Player.Character then
AddHatToCharacter(Player.Character)
end
end
end
end)
game:GetService('Players').PlayerAdded:Connect(function(Player)
if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, GAMEPASSID) then
Player.CharacterAdded:Connect(function(Character)
AddHatToCharacter(Character)
end)
end
end)
Yes but in where i put the hat for the players buy the gamepass?
That statement makes no sense to me, but if you are asking how do I make the players get a hat, there are many methods. Can I see an explorer view of your hat?
I said the explorer view, not the hat image.
oh sorry
i don’t know so much english, but i think you say…
well i don’t know…
explorer view you mean the toolbox or the models in the game?
No, this kind of stuff.
so i make this game recently and first i wanna know is this
You should update your model to an accessory, once it’s an accessory just use the code that I posted earlier (with the Accessory parented to the script, (name of the Accessory does not matter).
Make sure the script is under ServerScriptService.
ok i will try
but the accesory i need to put it in replicatedstorage? or in where?
Please read my post.
wait i’m gonna put a image if what i do is good ok?