I am looking to make my own MDT (Mobile Data Terminal) for a Police Roleplay Game I am creating.
However, I can not wrap my head around the logic part of the MDT. Such as saving a user’s data. Under the user, they would have the following: 1. Arrest Reports 2. Recent Written Warnings/Citations 3. The user who wrote 1 and 2. I looked at scripting helpers and the developer forum itself. I did not find anything useful. I do not want any code, just the logic so I can learn or any links or tutorials that would be helpful.
Thanks in advance! (This is my first developer forum post so I am sorry if I did anything wrong.)
Hey there! This type of stuff is fairly basic once you get tables/dictionaries and data handling down. You can start by looking around the wiki/forum on the usage and examples of DataStore.
DataStore is the service provided by Roblox which is essentially your ticket into accessing their backend SQL tables to add/alter your own rows (just a reference in case you have some web development logic). You can save your data to there, which in your case would either be a table or a dictionary, depending on how you decide to manage your data.
Personally I love dictionaries since it allows for the best organization. In a table, you’re indices will be 1,2,3 and so on. For a dictionary, you can set your own custom index, also known as a key, to be any object you wish! A string, boolean, or a physical object in the game (Note: Cannot save physical objects to a DataStore). After reading up on that, you’ll get the idea that any key of the dictionary could describe its purpose, such as “arrestRepports” being a key, and its value being a table in which you store the reports! Each report within the table can be ANOTHER dictionary (or array if you prefer) which can hold the reporting officer, reason, etc.
After combining both your knowledge of table manipulation as well as data saving/loading, you’re good to go! If the client wants to take a peek at say the arrest records, just set up a RemoteFunction that’ll ask the server to fetch and return the information. Overall, the wiki (now renamed to developer.roblox.com) will be able to provide you the documentation on everything I talked about as well as examples. Search the forums for similar questions you may have, and you should be good to go.
P.S. I noticed you play the game I work on (Emergency Response: Liberty County), so this exactly how we did it!