How can I save new values to DataStore2?

I’m aiming to create an Auto Shop for my game, and would like to create a system where, when a player buys a vehicle, it saves a “Vehicled Owned” value to their DataStore2 profile inside a table. I can create specific values for them upon spawning, but if I add more vehicles in the future it’ll be a pain to have to update the DataStore for every single new model. I’ve tried adding values to the table but it doesn’t save upon the player leaving. Here is my code:

I want to add additional values under “Vehicles” in the table, but only when a player purchases a vehicle. Is there a realistic way to do this?

1 Like