Implement Datastore values before or after conditions?

I don’t know which way is technically better to implement in terms of structure and non-needed values.

In my game I have races and some races need certain values and some don’t have the same ones as the other ones. I was wondering should I just implement the values that the other races don’t need or should I manually insert them depending on if they have it or not.

Example:

Race1 = {
Name = "lorem",
LastName = "ipsum",
Rank = "Captain",
Division = "Flower", -- needed, but race2 doesn't need
DivisionSeat = 1, -- needed, but race2 doesn't need
}

Race2 = {
Name = "lorem",
LastName = "ipsum",
Rank = "Number",
RankPosition = 209, -- -- needed, but race1 doesn't need
}

To be honest, I’d recommend you still save it to the player’s data, just in case so you don’t get any errors in the future, so yes, you should add it when its first created

1 Like

So add the non-needed values to the races that don’t need them?

yes, if you later need to change anything, you wont need to do checks or incase anything breaks

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.