Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is it possible to save weapons efficently?

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)

2 answers

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.

5 comments

0

Good job, I don't know where the -rep came from.

0

thx

0

The negative rep came from the fact that xuefei didn't reap OP's question.

0

Hey, could you accept my answer please? Because it gives me and you rep

0

Your "answer" is exactly what i've stated that is what I thought is already possible.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.