• Attempt to call field 'Msg' (a nil value) Help
    6 replies, posted
Can somebody help me solve this issue? I am trying to get PCMod working again :o Console Error: [CODE] [ERROR] addons/pcmod2/lua/pcmod/sh_tool.lua:69: attempt to call field 'Msg' (a nil value) 1. SpawnEntity - addons/pcmod2/lua/pcmod/sh_tool.lua:69 2. LeftClick - addons/pcmod2/lua/pcmod/sh_tool.lua:213 3. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:240 [/CODE] sh_tool.lua Lines 68-70 [CODE]68 function PCTool.SpawnEntity( ply, model, pos, ang, entclass, harddrive, setupdata ) 69 PCMod.Msg( "Spawning entity: " .. model .. "," .. entclass, true ) 70 [/CODE] sh_tool.lua Lines 212-213 [CODE]212 // Make the entity 213 local ent = PCTool.SpawnEntity( ply, model, pos, ang, self.EntClass, nil, setupdata ) [/CODE]
PCMod.Msg is nil.
How do I fix this?
Shared Function [lua]// --------------------------------------------------------------------------------------------------------- // Msg - Prints a PCMod message to console // --------------------------------------------------------------------------------------------------------- function PCMod.Msg( msgtext, isdebug ) if ((isdebug == true) && (PCMod.Cfg.DebugMode == false)) then return end if (isdebug == true) then table.insert(PCMod.MsgDebugBuffer, { PCMod.BufferI[1], msgtext }) PCMod.BufferI[1] = PCMod.BufferI[1] + 1 else table.insert(PCMod.MsgBuffer, { PCMod.BufferI[2], msgtext }) PCMod.BufferI[2] = PCMod.BufferI[2] + 1 end Msg( "PCMod2: " ) Msg( msgtext ) Msg( "\n" ) end[/lua]
[QUOTE=KingofBeast;38256647]Shared Function [lua]// --------------------------------------------------------------------------------------------------------- // Msg - Prints a PCMod message to console // --------------------------------------------------------------------------------------------------------- function PCMod.Msg( msgtext, isdebug ) if ((isdebug == true) && (PCMod.Cfg.DebugMode == false)) then return end if (isdebug == true) then table.insert(PCMod.MsgDebugBuffer, { PCMod.BufferI[1], msgtext }) PCMod.BufferI[1] = PCMod.BufferI[1] + 1 else table.insert(PCMod.MsgBuffer, { PCMod.BufferI[2], msgtext }) PCMod.BufferI[2] = PCMod.BufferI[2] + 1 end Msg( "PCMod2: " ) Msg( msgtext ) Msg( "\n" ) end[/lua][/QUOTE] Is there a certain place I should put this?
It came out of lua/pcmod/sh_common.lua
Confused..
Sorry, you need to Log In to post a reply to this thread.