I don't know lua, though I'm decent with a few other languages, so I'm not entirely ignorant in regards to tables and such
I found this code online and was trying to use it but it keeps spitting out a table index is nil
error.
I've been looking at a few other questions and issues online with the same error message, but still can't solve it.
I asked the author for some help but he can't figure it out either. Apparently the error doesn't happen for him.
Here's the code:
local RolePoints = {
[ROLE_DETECTIVE] = {[ROLE_DETECTIVE] = -250,--Killed Detective as Detective
[ROLE_INNOCENT] = -50,--Killed Innocent as Detective
[ROLE_TRAITOR] = 20
},
[ROLE_INNOCENT] = {[ROLE_DETECTIVE] = -250,
[ROLE_INNOCENT] = -20,
[ROLE_TRAITOR] = 20
},
[ROLE_TRAITOR] = {[ROLE_DETECTIVE] = 30,
[ROLE_INNOCENT] = 10,
[ROLE_TRAITOR] = -500
}
}
In particular, the interpreter claims that this line is the culprit:
[ROLE_DETECTIVE] = {[ROLE_DETECTIVE] = -250,--Killed Detective as Detective
Any ideas?
Thanks
EDIT: I've found that it works if I put it on my own client (though it still gets the errors) but won't work on my server.