lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

nepluto wrote: problem is, i was wondering if there was a way to use more then 1 value in em, such as a players Name, Rank, and online status or even just Name and Rank.... As the mod i am creating needs to have sort of a "Leader" if you will....
I figure that you should just store the leader as the first person in the table. Here's a little something I threw together: local guild = {{name="Some Guy",rank="General",_online_=true}, {name="A Dude",rank="Captain",_online_=false}} for i=1,#guild do if i==1 then print("Leader:") else print("Player-" .. (i-1) .. ":") end for v in pairs(guild[i]) do print("\t" .. v .. " = " .. tostring(guild[i][v])) end end Is that kind of what you were going for?

View this message in context: Re: Tables in LUA
Sent from the Lua - General mailing list archive at