How would I create a pet datastore?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
  • A datastore to hold the pets you have equipped and in your inventory.
  1. What is the issue? Include screenshots / videos if possible!
  • Currently do not have an Idea of how I could create this.
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
  • I’ve tried looking on youtube and the dev forum but most of these don’t include everything I’m looking for.

(I’M NOT ASKING FOR ANYONE TO SCRIPT THIS, JUST A BRIEF EXPLANATION ON HOW I WOULD CREATE THIS)

1 Like

note: I am not a super pro scripter but I will give it a go
for every pet there’s a string that represents it(Name), So let’s say you have a bunch of cool pets, and let’s say they are 3. The first one is called bluepet and the second is redpet and the third is yellowpet
First of all, we will need to store them in an array let’s call this array “pets”
pets = [“Bluepet”, “Redpet”, “Yellowpet”]
we will just basically save it in this form and store it in the datastore.

Could you also have a Boolean that is called Equipped and if the pet is equipped it will be true, you save this Boolean value in the datastore, and then you check when a player joins if any of the [petname].Equipped.Value is true then it would go ahead and equip it?

1 Like

I think yeah you could do and you also could make another array called “petsequipped” and save it in the data store

another way is by using dictionaries to save bunch of arrays inside it
Note again: Im, not a super pro scripter pretty sure there are better ways of doing it