.Magnitude question

Sorry for the bother but I’m still not getting what you’re meaning.
Do you mean the propertyTable; because it has to be a table and tables can only be created via {} (Brases).

lets say if i were to use () in a table, would that be different from using {} in a table?

Could you give me an example (lol sorry).

will this:
local boom = {“boom”, “bang”, “kaboom”}
be different from this:
local boom = (“boom”, “bang”, “kaboom”)

Tables can only be created with {}, if you were to do:

local boom = ("boom", "bang", "kaboom")

Then boom would only be assigned to “boom”, therefore you’d have to do:

local boom, bang, kaboom = ("boom", "bang", "kaboom")
1 Like

The Lua/C++ barrier would likely negate any performance benefits.

Seems like a bad reason to add API bloat to save a few lines of code.

so what uses square brackets? Thank you for staying with me

1 Like

Square brackets are for indexing or creating indexes for tables:

local dictionary = {
    ["Cheddar cheese! Yum!"] = "Very nice";
}

dictionary["Wendsleydale cheese.. Eh.."] = "Nope"

print(dictionary["Cheddar cheese! Yum!"]) --Very nice

Also, they can be used to index children of Instances:

local part = Instance.new("Part")
part.Anchored = true
part.Name = "Ok I do like my cheese"
part.Parent = workspace

print(workspace["Ok I do like my cheese"].Anchored) --true

I’d personally use FindFirstChild over this though.

5 Likes