Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 08 May 2015 01:52 AM |
if aktion == "add" then for k, v in pairs(inventar) do if v == nil then v = was) end return end inventar[#inventar + 1] = was
is in
function inv(aktion, was, inventar)
i call
local inventory = {"Hand", "Axt"} inv("add", "Hacke", inventory) print(inventory[3])
it prints nil |
|
|
| Report Abuse |
|
Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 08 May 2015 01:58 AM |
welcome to stupid land
im stupid
heres what it SHOULD be
if aktion == "add" then for k, v in pairs(inventar) do if v == nil then v = was end return -- this return needs to be in the "if v nil then v was end" end inventar[#inventar + 1] = was |
|
|
| Report Abuse |
|
Keruro
|
  |
| Joined: 23 Nov 2013 |
| Total Posts: 2327 |
|
|
| 08 May 2015 05:27 AM |
| Well ┬─┬ ︵ /(.□. \) In soviet russia, Table flips you |
|
|
| Report Abuse |
|