waqmaz
Member
- Joined
- Jun 17, 2015
- Messages
- 203
- Reaction score
- 11
Lets say I have a function with an array:
Why won't it work? I mean "from" and to
I want to call it like this way:
Code:
local function tp(from, to)
local pos = {
['pos_start'] = {
{['x'] = 179, ['y'] = 367, ['z'] = 7},
{['x'] = 666, ['y'] = 222, ['z'] = 7}
},
['pos_end'] = {
{['x'] = 1555, ['y'] = 12, ['z'] = 7},
{['x'] = 1127, ['y'] = 124, ['z'] = 7}
}
}
-- lets say we havea for loop here so we can add "i"
doSendMagicEffect(from[i], CONST_ME_POFF)
doSendMagicEffect(to[i], CONST_ME_TELEPORT)
end
Why won't it work? I mean "from" and to
I want to call it like this way:
Code:
tp(pos['pos_start'], pos['pos_end'])