I'm making an RPG, and I am getting to the point where I will soon have to save/load weapons when players join/leave.. With that said, I have no idea how to do it. (Well, that's a lie.. I know one way but it's a bit tedious?) The way that I would currently do it is to save/load a "bool" value (1 or 0) depending on if they have that weapon when they leave, if they have that weapon, it will be set to 1, if they don't. It will be set to 0.
But that might take a bit of time to do depending on the amount of swords/weapons are set up in the game.. Is there any way other then what I've stated work better?
If there is a better way to handle this situation, please don't give me a script. I want to script it on my own. Rather, give me the information needed in order to script it and I will do my best to make it! :D (After all, it's a helpers, not a do-er? XD)
You first have to consider what the unique aspects of each weapon are.
For a pure-stats weapon, for example, those would be:
Name, Damage (typically two values, to indicate a range), Attack Speed, Stat Modifiers (I would use a table for this: {statName = modifierValue}), Flavor-Text (if applicable), ModelID, TextureID.
The last two could be joined into just an 'appearance' Table to dictate all the appearance-related stuff for the weapon.
If a weapon has a special effect (like many of WoW's trinkets for instance), I would suggest making those Unique items. And by that, I mean, they are pre-defined (not randomly generated), and all you save is the item's ID. When the Player loads in, read the ID, figure out what item it is, and give it to them.
Its basically the same as a leaderstat save with data stores, but you will make a BoolValue For every weapon you make, and when they buy it, it will make the BoolValue true, and put the list of Values in a folder in the player, say like name it Weapons and when they leave save them, and do a lot of if and elseif to give the weapons for when they rejoin
Hope this helps.