I don’t wanna talk to much, i’m frustrated.
How do I print all the module children:
I’ve only used module scripts with user id’s, I’ve never used strings, how do I get the children.
I don’t wanna talk to much, i’m frustrated.
How do I print all the module children:
I’ve only used module scripts with user id’s, I’ve never used strings, how do I get the children.
I know I’ve messed up the module, with that comma, i fixed it rn
In this instance you would print the index, “i”!
No ape, V is the object, I is how many times it looped.
Nope, i is the index, try it out!
The only way it would print that is:
I’ve never known this, why is it built that way
Hopefully this helps:
local Example_1 = {
"Hello",
"Goodbye",
}
for index, tableString in pairs(Example_1) do
-- index in this case would be the position of the data
print(tableString)
--[[
Expect Output:
Hello
Goodbye
--]]
end
warn('-----')
local Example_2 = {
["adios"] = "Goodbye",
["Hola"] = "Hello",
}
for index, tableString in pairs(Example_2) do
print(tableString)
--[[
Expect Output:
Goodbye
Hello
--]]
end
This table right here: local Table = {"Hi! :D"}
each string has a position, in this case the string “Hi! :D” would be ‘1’, when talking about table positions you use the word ‘index’!
If I asked you the string in the table below, with the index of 2, you would respond with “correct”
local Table = {
"wrong",
"correct",
}
same thing goes with strings as indexes!
local Table = {
["Correct"] = true,
["Incorrect"] = false,
}
Hopefully after reading this, your knowledge of indexes in lua is Table["Correct"]
Appreciate for the help, I needed this
I now understand much more about modules