Jump to content

Helppp!!! :(


s1mple

Recommended Posts

    for i,weaponData in ipairs(weaponAmmoTable["Makarov Mag"]) do 
        if weaponName == weaponData[1] then 
            return "Makarov Mag",weaponData[2] 
        end 
    end 

[2015-10-03 05:55:24] ERROR: [DAYZ]/DayZ/pickups.lua:470: attempt to index global 'weaponAmmoTable' (a nil value) 
[2015-10-03 05:55:24] ERROR: [DAYZ]/DayZ/pickups.lua:470: attempt to index global 'weaponAmmoTable' (a nil value) 

Link to comment

If the whole table was empty and he was trying to loop through it, there would be no output. Run this: t = {} for i, v in pairs(t) do outputChatBox(v) end

Your table is not defined, simple as that. In Lua, if something is not defined and you try to reference it, it will return nil. Make sure you have defined weaponAmmoTable in your code somewhere.

Link to comment
If the whole table was empty and he was trying to loop through it, there would be no output. Run this: t = {} for i, v in pairs(t) do outputChatBox(v) end

Your table is not defined, simple as that. In Lua, if something is not defined and you try to reference it, it will return nil. Make sure you have defined weaponAmmoTable in your code somewhere.

Of course it wouldn't output anything from an empty table, that's what KariiiM said. Whether it's not defined or empty, both would return nil errors. Only difference being the actual error. :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...