Question for advanced scripters

Ive only been scripting for just over a year, and one thing that always comes up when scripting a game is a shop. the way I do a shop is make a data store such as “Shirts” and then ill create a list of shirts the player has bought defultly set to an empty list. then when a player purchases a shirt ill add it to the list and then use a script to detect the change and take the shirt from lighting and give it to the player.

I feel like this is the wrong approach cause im wondering how in some game players will leave with an item equipped and come back with it saved on them. and also the codes are long and messy but that might just be me

Im just curious to know how everyone tackles in game shops or if anyone knows a video I can find of an advanced scripter showing the easiest cleanest way to do this.

Thanks for reading ~ Anon

I personally would create a dictionary with the keys being the name of the shirt and then a boolean value associated with it set to true or false if owned and then have an equipped string or int value that determines what they are wearing and save it along with the others datavalues on playerremoving.

1 Like

ngl completely forgot dictionarys existed. I might have try that method for the thing i’m working on.

thanks for the response

1 Like