Hello, i was working with module scripts as data base before, but now when i try same i get this on output:
module script:
local dataBase = {
["Shack"]= {
["cost"] = 0,
["CanBeBuilt"] = false,
["PeopleCount"] = 2,
["types"] = 3
},
}
return dataBase
Server script
database2=require(game.ReplicatedStorage.ObjectStats)
print(database2["Shack"])
Is something wrong in scripts or module scripts have changed?
Thank you!
I don’t really understand you problem. What you’re doing is working. Basically you got your dataBase table and you print out your Shack table inside of it. If you try to access the values inside Shack then simply do this.
database2["Shack"]["cost"]
1 Like
I was stupid to forget this, thanks mate for helping.
But wait, is there way to make script list all values that are in shacks?
Sure, just do this.
for index, v in pairs(database2["Shack"]) do
print(index, v)
end
1 Like
aca1231231
(aca1231231)
August 11, 2020, 10:00am
5
Perfect, i would like to put this as second solution but i cant…
You helped a loot!
Cheers from Serbia