I have this taunt menu I’m trying to get to work but this happens when I have the function to be able to open the menu with F4.
The following error does not show though when it is set to just be a concommand.
[ERROR] lua/includes/extensions/table.lua:99: bad argument #1 to ‘pairs’ (table expected, got nil)
pairs - [C]:-1
HasValue - lua/includes/extensions/table.lua:99
fn - addons/prop hunt taunts/lua/autorun/sh_taunt.lua:16
unknown - addons/ulib/lua/ulib/shared/hook.lua:183
Any idea what could cause this sort of error?
Rubat
(Rubat)
March 18, 2014, 9:22am
#2
You supply a nil value to first argument of table.HasValue( t, val ) in your code, at sh_taunt.lua line 16.
Line 16 looks like this:
if table.HasValue(PHT_config.ChatCommands, strtext) then
Rubat
(Rubat)
March 18, 2014, 9:36am
#4
PHT_config.ChatCommands is nil.
Well, “bad argument #1 ” means the first bit is causing issues, meaning there’s something wrong with ‘PHT_config.ChatCommands’.
Where is it used previously in the code?
Well, “bad argument #1 ” means the first bit is causing issues, meaning there’s something wrong with ‘PHT_config.ChatCommands’.
Where is it used previously in the code?
Line 2
if (SERVER) then
AddCSLuaFile("pht_config.lua")
I assume there would be some sort of config file, which you are missing?