Twistir
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 12374 |
|
|
| 24 Jan 2015 10:55 PM |
How do I put an item in a table and give it a price? Do I use a sort of dictionary?
|
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 10:58 PM |
items = { tool1 = 10 tool2 = 50 tool3 = 100 }
print(items.tool1) |
|
|
| Report Abuse |
|
|
Twistir
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 12374 |
|
|
| 24 Jan 2015 11:01 PM |
okay let me explain again.
I am making a game that involves buying clothing. In a table, I want to have the shirt id and how much it costs. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 11:10 PM |
clothing = { shirt = {id = 1436325,cost = 30}, pant = {id = 1396435,cost = 50} }
print(clothing.pant.id)
like this? |
|
|
| Report Abuse |
|
|
Twistir
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 12374 |
|
| |
|