✓ Accepted answer
In this case, "i" stands for the index (or key!) of the value (v) you are looking for.
Since this is a dictionary, there are a couple ways to reference them (but I can't list all of them as Roblox has built-in API to search dictionaries within the hierarchy of the game)
This means you can do this:
for i, v in pairs(tycoons) do
print(i)
end
But I'm assuming you want to access a specific tycoon and not iterate through each one.
In that case, you can do this for dictionaries, also known as tables that use non-numerical indices (which include, but are not limited to, Enum values, strings, table reference pointers, userdata, etc):
local tycoons = {}
tycoons["RedTycoon"] = "Hello."
print(tycoons["RedTycoon"])
print(tycoons.RedTycoon)
You search for them just like you do with normal tables, except the value type is different.
3 comments
i is index, v.Name will give you the name of the thing you want (if the things stored in tycoons are instances and not strings)
if you're storing these things in a dictionary ( e.g. local tycoons = { ["red"] = game.workspace.redtycoon } ... you can do local redtycoon = tycoon[red] to set the variable to equal the same instance as is stored in the dictionary...
Use if v = not if I=, v is what you’re looking for.