• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua lua kkey array substitution in loop

Lupek

New Member
Joined
Mar 30, 2020
Messages
26
Reaction score
1
Hello i have simple problem, i dont know lua too good.

Code:
positions = {
    x = 1026, y = 981, z = 7
}


function onStepIn(creature, item, position, fromPosition)
-
-
-
for i, value in pairs(positions) do
    creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, position.i) -- its not working for me
end

I want to substitute array key to creature object.
I want this effect:
position.x
position.y
position.z

just use [] brackets :) it's better way!
 
Last edited:
Back
Top