• PERP ERROR
    1 replies, posted
[perp\gamemode\cl_init.lua:101] attempt to index field 'ModelPanel' (a nil value)(Hook: Initialize) The code for cl_init is displayed below. this started to happen after the update on friday. [CODE]include('sh_init.lua'); include('cl_networking.lua'); include('cl_misc.lua'); include('cl_hooks.lua'); include('cl_scoreboard.lua'); GM.TalkDatabase = {}; function GM:RegisterTalk ( Name, Function ) self.TalkDatabase[Name] = Function; end for k, v in pairs(file.FindInLua('perp/gamemode/vgui/*.lua')) do include('vgui/' .. v); end for k, v in pairs(file.FindInLua('perp/gamemode/cl_modules/*.lua')) do include('cl_modules/' .. v); end for k, v in pairs(file.FindInLua('perp/gamemode/npc_scripts/*.lua')) do include('npc_scripts/' .. v); end function GM:Initialize ( ) self.VGUI = {}; self.VGUI.HUD = vgui.Create('perp_hud'); self.VGUI.Talk = vgui.Create('perp_talk'); self.DropItemSound = 'items/ammocrate_close.wav'; self.GainItemSound = 'items/ammocrate_open.wav'; self.CantAfford = 'buttons/button10.wav'; util.PrecacheSound(self.DropItemSound); util.PrecacheSound(self.GainItemSound); util.PrecacheSound(self.CantAfford); self.LastItemMove = 0; FireEmitter = ParticleEmitter(Vector(0, 0, 0)); SmokeEmitter = ParticleEmitter(Vector(0, 0, 0)); SmokeEmitter:SetNearClip(50, 200); RunConsoleCommand('rate', '30000'); self.VGUI.Talk:SetVisible(false); self.VGUI.Talk:SetAlpha(0); self.VGUI.Talk.ModelPanel:Remove(); gui.EnableScreenClicker(false); end include('sh_post.lua'); [/CODE] Please help me with this,
Do an if statement to check if the ModelPanel is valid.
Sorry, you need to Log In to post a reply to this thread.