Simulator Shop System

So I am trying to make a new tool shop system for my game. My last one was pretty bad because it had so many values. This time I am trying to make it using tables so it stores all the values such as weather you have it owned or locked. Problem is I have no idea where to start or saving tables. And plus I am trying to make it so the first tool is given to new player. I just have no clue how to do. And please don’t recommend me the Alvin Blox tutorial. I don’t want camera manipulation.

image

2 Likes

Like I said previously you can just use JSON it’s pretty simple.
E.g

local tableVar = {"4Locked"=1}
local stringVar = game:GetService("HttpService"):JSONEncode(tableVar)
print(stringVar)

and you just use JSONDecode to turn it back into a table for adding the values.

But I am not getting why I have to use `nother program and understand it just for a simulator shop. Plus I jsut watched a video on it and seems like there are barely any recources on it. Plus Lua is the only programming language I know.

You’re not using another language for this it’s lua. JSONEncode just runs a callback which is a string containing the table from tableVar. So that variable is now a string, and you can save it to your datastore.

You can then decode it with another variable to transform it back into a table so you can set stats. And the best part is you’re not saving 80 values into a datastore you’re just saving 1 thing containing it all.

How many items do you have? and are the only questions you need to save: Is it locked? and Is it owned?

yes only that. Basiclly using tables to save.