Hey! So I’ve been working on a game where you can shop for premade outfits and it’s almost ready for publishing, I just need to add a few small features. I looked into this already and tried re-wording what I look up to see if I could find this fix but I couldn’t find an exact one. I have a lot of outfits in my game(over 300) and implementing each individual ID into a script and adding a purchase prompt for each item would just take ages to add. I’ve seen games like catalog avatar creator make it so when you purchase something it says your username, what you purchased, and the price. I would like that in my game. is there is easier way to do this? without adding each individual ID in a script? Sorry if it’s like a mess I just don’t really know the best way to describe this. if you need me to try to describe better I can do my best just ask. THANK YOU!
when you want to repeat the same code multiple times you should use loops
local outfitFolder = game.Workspace.outfitFolder -- example folder
for index, outfit in ipairs(outfitFolder:GetChildren()) do
print(index, outfit) -- index will count up like 1,2,3,4,5.
--outfit will be the outfit (child instance) inside of the outfitFolder, so you can paste the outfit script inside the loop and adjust it
end
Hi. That isn’t really what I’m asking for but it’s a start. All the accessories and shirt ID’s are put inside the Humanoid description in their corresponding categories, like a shirt id would go into the shirt spot, head accessory id inside an accessory spot, etc. I have it set so everyone can purchase whatever is necessary for the outfit already, this is just like a small feature that I think I could benefit off of. I know there has got to be an easier way to make it so when someone purchases one of those, it shows up in the chat, I’m just not sure how. Rather than just adding each individual ID in a script. Considering I have over 300 outfits and each outfit has a minimum of like 8 ID’s I would have to copy, it would take ages to do that.
Purchases the entire outfit, or a component of it?
Hi. I have it set so when you walk up to an outfit, it gives a prompt and it opens a ui that has all the outfits components in it.
Sorry, this does not answer my question. I want to know whether or not you want an announcement to be made when a user buys the entire outfit or a piece of it
Ohhhh, sorry I completely misread that. I’d like it to say when a user purchases each item.
I just looked throughout my whole code and didn’t see anything related to marketplace service nor any of the methods that were listed. If I’m being honest I followed a YouTube tutorial on TwinPlayz channel considering it was one of the popular ones to use, considering I’m relatively new to scripting, especially a game like this one. if you can’t help me it’s fine I’ll just keep trying to dig deeper into google and what not or just mess around with possible options I could try.
Does your code allow you to buy the individuals items off outfits, or only the outfit? Can you buy either in the first place?
You can buy each individual piece of the outfit you want. so if there was one or 2 items someone didn’t want on the outfit, they can pick and choose what they want and just not buy what they don’t want.
Can you send a recording of this?
yes here
This does utilize MarketplaceService
at some point. You cannot prompt users to make the purchase in this format otherwise. Use Ctrl + Shift + F
to make a global search for the service throughout your codebase
found it. thank you. I’m using ‘PromptPurchase’
You can use its associated event “MarketplaceService.PromptPurchaseFinished” to detect whenever a user follows through with the purchase of any asset
I’m gonna give that a try, it seems really promising. Thank you so much for all your help, seriously!!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.