Getting a module script Table

Hello, I’m trying to get table contents of a table within a module script. When I am calling the table it only returns this: table: 0x7217ba0a019611c2. How could I make it return like a “Normal” Table. Plane = {Somethings = “Something”} etc. I’ve tried to do some searching but I don’t completly understand it.

Calling Script

local Wable = require(game:GetService("ReplicatedStorage"):WaitForChild("ModuleScript"))

print(Wable)

ModuleScript

local module = {Hello = "HEllo"}
return module

I’m mot sure if it’s what you’re looking for but try something like this.

print(Wable.Hello)

You can also do this with other values that would be in that table.

1 Like

Not exactly what I tried to look for but is there a way to print the whole table, if I had several variables in the table. For example if it was module = {Hello = “Hellos”, MyName = “RobloxCoDev”, Yohaj = “Yobah”}

Then print it out as like that, like it would with a normal table in a server script.

Maybe there is a way. I just can’t really help you rn because I’m on mobile now.

I think you are not able to print table like this in a server script… Pretty sure that there is not a way to print a variable’s name, but correct me if I’m wrong.

There is a documentation on the tables. If there isn’t anything about printing a table then probably you can’t.

If you wanna know all the values from a table use for pairs, I pairs and pairs

Example:

local Table = {A = "Hello", Ka = "Hi", Hj = "Goodbye"}
-- if the table is in a module then replace by: local Table = require(MODULE).TABLE
for Key,Value in pairs (Table) do
print(Key)
print(Value)
end

--[[ output:
A
Hello
Hj
Goodbye
Ka
Hi
]]
2 Likes

Can confirm, this was the way to go