• [Gmod lua] Fix a nil in lua .
    6 replies, posted
\gamemode\vgui\item_enlarged.lua:41] attempt to index field 'Entity' (a nil value) and this code is on line 41 [code][LUA]local PANEL = {}; function PANEL:Init ( ) self:SetSize(165, 165); end function PANEL:PerformLayout ( ) end function PANEL:Paint ( ) end function PANEL:PaintOver ( ) end function PANEL:SetItem ( Item, Type ) if !GAMEMODE.ItemDatabase[Item] then DebugMessage(Item .. ' is not a valid item.'); return false; end if self.MonitorItem == Item and self.MonitoringType == Type then return false; end self.MonitorItem = Item; self.MonitoringType = Type; local ItemTable = GAMEMODE.ItemDatabase[Item]; if self.ModelPanel then self.ModelPanel:Remove(); end self.ModelPanel = vgui.Create('DModelPanel', self); self.ModelPanel:SetModel(ItemTable.Model); self.ModelPanel:SetPos(4, 4); self.ModelPanel:SetSize(self:GetWide() - 8, self:GetTall() - 8); self.ModelPanel:SetCamPos(ItemTable.ModelCamPos) self.ModelPanel:SetLookAt(ItemTable.ModelLookAt) self.ModelPanel:SetFOV(ItemTable.ModelFOV) function self.ModelPanel:LayoutEntity( Entity ) end local iSeq = self.ModelPanel.Entity:LookupSequence('ragdoll'); self.ModelPanel.Entity:ResetSequence(iSeq); end function PANEL:BlowItem ( Item, Type ) if self.MonitorItem == Item and self.MonitoringType == Type then self.ModelPanel:Remove(); self.MonitorItem = nil; end end vgui.Register('perp_item_elarged', PANEL);[/LUA][/code] This error is also before that error [lua\vgui\dmodelpanel.lua:69] ClientsideModel cannot be called while rendering This is also an error we get gamemode\cl_init.lua:101] attempt to index field 'ModelPanel' (a nil value)(Hook: Initialize) Not sure if that could be the problem [code]/* if !MadeThisShit then local OldHook = hook.Add; local DontReport = {'DrawHUDIndicators', 'WireHUDIndicatorCVarCheck', 'Keypad_KeyReleased', 'ShuttleInitAddProxy', 'ShuttleDrawInfoOverlay', 'MyCalcView', 'RSS', 'ITEM.MakeEffects_BEER', 'ITEM.MakeEffects_Weed', 'ITEM.MakeEffects_SHROOMS', 'GM.SprintThink', 'GM.VehicleFindThink', 'GM.DoShouldDraw', 'GM.GetInitialDownload', 'GM.PaintNotes', 'GM.CalcRagdollEyes', 'GM.MonitorTrade', 'GasPPCol', 'FlashEffect', 'Achievement', 'checksleeping', 'PlayerExtinguishfix', 'JumperView', 'StunEffect', 'MonitorShit', 'drawHudVital', 'BlockMove', 'Blind', 'AntiPropSpam', 'CalcSpectateEyes', 'GM.MonitorWeatherPatterns', 'GM.WeatherEffects', 'MonitorRadios', 'RadioDrawSomeShit'}; local FileContentBlockage = {'XRay', 'Heat-Vision', 'Teta_Bonita', 'z-machine', 'Nautical', 'NBot', 'nBot', 'AimFixer', 'ValveBiped', 'GetBonePosition', 'JetBot', 'AIMBOT', 'aimbot', 'esp_', 'ESP', 'AimBot', 'Hack', 'hack', 'PaintBotNotes', 'entx_', '+prefix_aimbot_scan', 'JetBoom', 'jetboom', 'teta_bonita', 'LAST_SUICIDE', 'SpazHookName', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'BOT_', 'bot_', 'cl_forwardspeed', 'XRAY', 'jof_', 'lmao_', 'you_ON', 'ucCommand', 'aimataim', 'Night-Vision', 'toggle_nightvision', 'effects/nightvision', 'ToggleNightVision', 'funcsolver', 'host_timescale', 'wowspeed', 'speedhack', 'SLOB', 'SlobBot', 'wireframeenabled', 'FRT', 'BLB', 'FLT', 'BRT', 'BLT', 'MegaAIM', 'autoattack', 'MingeBag', 'DarkRP', 'WireFrameHax', 'wots_attack', 'slobpos', 'Admin list', 'wots_', 'smartsnap', 'DrawBoundary', 'snap_', 'Arealmouse', 'wallers', 'wall/prop', 'H4X', 'AnimateName', 'CCTV', 'Ulysses', 'Mblunk', 'Crosshair_', 'FindNearestNode', 'EmergencySave', 'nodet_', 'afk', 'AFK', 'CalculatePath', 'GLON', 'JBF', 'GcDesign', 'radar', 'Radar', 'gspHUD', 'gogogog', 'durgz', 'Hoverboard', 'cl_sbmp_fighter', 'Wire', 'Expression', 'Portal', 'Aeolus', 'HoloPress', 'Stargate', 'FKeyPressedHook', 'ShowSprayOwner', 'V a l v e B i p e d', 'darklandrp', 'AntiPropSpam', 'Pikmin', 'fastundo', 'ChevronSprites', 'lol_'}; if !file.Exists('pr2.txt') then file.Write('pr2.txt', ''); end function hook.Add ( One, Two, Three ) local What = debug.getinfo(2); local SourceFile; local SourceLoc = string.gsub(What.short_src, '\\', '/'); if file.Exists('../gamemodes/' .. SourceLoc) then SourceFile = file.Read('../gamemodes/' .. SourceLoc); elseif file.Exists('../lua/' .. SourceLoc) then SourceFile = file.Read('../lua/' .. SourceLoc); elseif file.Exists('../lua_temp/' .. SourceLoc) then SourceFile = file.Read('../lua_temp/' .. SourceLoc); end if !SourceFile then Msg('ERROR -> ' .. One .. ' -> ' .. Two .. ' -> ' .. SourceLoc .. '\n'); OldHook(One, Two, Three); return false; end for k, v in pairs(FileContentBlockage) do if string.find(SourceFile, v) then Msg('Blocked ' .. One .. ' -> ' .. Two .. '\n'); return false; end end local Report = true; for k, v in pairs(DontReport) do if string.find(Two, v) then Report = false; end end if Report then if string.find(file.Read('pr2.txt'), One .. ':' .. Two) then Report = false; end end if Report then timer.Simple(1, RunConsoleCommand, 'perp_lhc', One, Two, What.short_src); file.Write('pr2.txt', file.Read('pr2.txt') .. '\n' .. One .. ':' .. Two); end OldHook(One, Two, Three); end end MadeThisShit = true; */ 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]
PERP is buggy and leaked.
put them in lua damn i cant read
how to put this in lua please thanks .
[noparse][LUA] yourcodegoes here [/LUA][/noparse] It looks like you are either not setting the model, or are not setting a valid model. The first 2 errors are of the same thing. The last error, self.VGUI.Talk.ModelPanel is never set to anything.
Fyi if you cant get perp to work don't expect us to help you its a leaked gamemode and we have enough perp servers as it is
Perp run and fixed ^ ^ it's just some little mistakes on menus ... thank you for your help
Sorry, you need to Log In to post a reply to this thread.