Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I Get and Set Module data using datastore?

Asked by
B_rnz 171
6 years ago
Edited 6 years ago

I've decided to make a murder-mystery related game, but I don't know how to get anywhere with the module I have made.

I was planning to use folders and just use bool values, but that would take too much of my time. Modules are much cleaner/neater to use and find any data you want in my opinion.

Overall, I just need help with the modules and how can I get/set the data inside of it using :GetAsync() and SetAsync()? So that once that player joins the starter table inserts a GUI with a basic knife image, rarity, imageID, textureID, MeshID.

What I can do so far:

  • Loop through a table to get the data's variable. Using for pairs().
  • Create a table inside of a table. (Obviously)

What I can't do so far:

 • Save the player's module data.
 • Create the knife using the table that has the meshID and textureID.

What I did:

 -- Module script:
local Knives = {ItemName = {"Rarity", "ImageID", "MeshID", "TextureID"}; ItemName2 = {"Rarity", "ImageID", "MeshID", "TextureID"};}

return Knives

-- script:
local M_Knives = require(script:FindFirstChild("M_Knives"))

for i, v in pairs(M_Knives) do
    print(v[1])
end

0
There's probably much more.. but I just need to do what I can for now. B_rnz 171 — 6y
0
I think you have to show us a script to help you with idk xxcoordinatorxx 135 — 6y
0
I edited it ^ B_rnz 171 — 6y
0
So what part of it is broken?? xxcoordinatorxx 135 — 6y
View all comments (7 more)
0
It's not broken, I just need a brief explaination on how to use GetAsync() and SetAsync() using the table I have. B_rnz 171 — 6y
0
Lol i think that only works with leaderstat values but i may be wrong! Hopefully i am xxcoordinatorxx 135 — 6y
0
You're trying to save data using SetAsync without using DataStore????? vanilla_wizard 336 — 6y
0
@BrendonTheWizard, No. I am trying to find a way to save the data once they have gotten the item in their inventory. B_rnz 171 — 6y
0
or joined. B_rnz 171 — 6y
0
But you're trying to *save* data without using DataStore??? vanilla_wizard 336 — 6y
0
I will use a datastore, I just don't know how to use the getasync() and setasync() using the tables I made. Not like I am using bool values. B_rnz 171 — 6y

Answer this question