hello all! i’ve been having a little mental issue with not being able to realize how i can do a thing.
i’m making a car game, and each car is going to have specific data that gets saved into a datastore, my issue, i don’t know how to make each car have its own individual set of saved values.
So pretty much, Car 1 would have a set of individual values (value1 and value2), and Car 2 would have the same set of values, but they would be unique to Car 2, and would not be the same as Car 1, same goes the other way.
Does anyone know how i could do this? i am genuinely lost with what to do in this case and this is something i need solved to be able to advance.
-- get your data per car
local car1 = {
speed = 1,
color = "red",
}
local car2 = {
speed = 2,
color = "yellow",
}
-- combine the tables into an array
local all_cars = {}
table.insert(all_cars, car1)
table.insert(all_cars, car2)
-- all_cars[1] == car1
-- save the combined table
datastore:SetAsync("ownedCars" .. player.UserId, all_cars)