Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to save weapons efficently?

Asked by
lomo0987 250 Moderation Voter
8 years ago

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

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
8 years ago

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.

Ad
Log in to vote
0
Answered by
xuefei123 214 Moderation Voter
8 years ago

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.

0
Good job, I don't know where the -rep came from. laughablehaha 494 — 8y
0
thx xuefei123 214 — 8y
0
The negative rep came from the fact that xuefei didn't reap OP's question. adark 5487 — 8y
0
Hey, could you accept my answer please? Because it gives me and you rep xuefei123 214 — 8y
0
Your "answer" is exactly what i've stated that is what I thought is already possible. lomo0987 250 — 8y

Answer this question