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

Accessing table data from other scripts? (Data Store)

Asked by 5 years ago

Not sure if I'm entirely making sense here but I'll try my best.

So I was looking around for an Inventory system and found this: https://scriptinghelpers.org/questions/65928/what-is-the-best-way-on-savinghaving-items-in-an-inventory

It looks really good and works how it should but the only thing I found confusing is how I could access these via another script such as a script that reads the tables and loads the inventory in a kind of way (not asking for something like this).

Say for example:

Player loads in with 2 nil and I wanted a seperate script to create guis under an inventory that have text labels of the item so like nil x2 or something.

But how can I do this from a seperate script?

another thing is accessing the curency value from a LocalScript to display the amount on a gui (kinda attached to the first part)

Again I want to make this clear I am not asking for someone to "Fix" this script I'm asking how I could access the data from another script.

Thank you and sorry for making you read.

0
If the client needs to access any data you'll need remote events User#19524 175 — 5y
0
Yes I understand this but how would I do this by having the datastore script handle every event? And how would I do server to client with GUIs? fire client? or store it in a seperate location for the players session. VeryDarkDev 47 — 5y
0
I would suggest looking into ModuleScripts for this. SuedeGod -5 — 5y
0
Yeah, incapaz is correct. Remote events/functions will do the trick. Read up on them, and you'll find that they can exchange data with each other. Look around the SH site and wiki, and you'll find countless examples Shawnyg 4330 — 5y

Answer this question