• _Newbees JailBreak Script Error (Common Problem)
    5 replies, posted
Ok, in _Newbees JailBreak, There is a lua error in cl_spawnmenu.lua Many people are having problems with this, myself included, and I was hoping if anyone might know how to fix it. :P [ERROR] gamemodes/jailbreak/gamemode/core/cl_spawnmenu.lua:404: attempt to index field 'Players' (a nil value) 1. fn - gamemodes/jailbreak/gamemode/core/cl_spawnmenu.lua:404 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183 Code: [CODE]local x,y = -1000,-1200 surface.CreateFont( "DebugFixed", { font = "Courier New", size = 10, weight = 500, antialias = true, } ) surface.CreateFont( "DebugFixedSmall", { font = "Courier New", size = 7, weight = 500, antialias = true, } ) surface.CreateFont( "DefaultFixedOutline", { font = "Lucida Console", size = 10, weight = 0, outline = true, } ) surface.CreateFont( "MenuItem", { font = "Tahoma", size = 12, weight = 500, } ) surface.CreateFont( "Default", { font = "Tahoma", size = 13, weight = 500, } ) surface.CreateFont( "TabLarge", { font = "Tahoma", size = 13, weight = 700, shadow = true, } ) surface.CreateFont( "DefaultBold", { font = "Tahoma", size = 13, weight = 1000, } ) surface.CreateFont( "DefaultUnderline", { font = "Tahoma", size = 13, weight = 500, underline = true, } ) surface.CreateFont( "DefaultSmall", { font = "Tahoma", size = 1, weight = 0, } ) surface.CreateFont( "DefaultSmallDropShadow", { font = "Tahoma", size = 11, weight = 0, shadow = true, } ) surface.CreateFont( "DefaultVerySmall", { font = "Tahoma", size = 10, weight = 0, } ) surface.CreateFont( "DefaultLarge", { font = "Tahoma", size = 16, weight = 0, } ) surface.CreateFont( "UiBold", { font = "Tahoma", size = 12, weight = 1000, } ) surface.CreateFont( "MenuLarge", { font = "Verdana", size = 15, weight = 600, antialias = true, } ) surface.CreateFont( "ConsoleText", { font = "Lucida Console", size = 10, weight = 500, } ) surface.CreateFont( "Marlett", { font = "Marlett", size = 13, weight = 0, symbol = true, } ) surface.CreateFont( "Trebuchet24", { font = "Trebuchet MS", size = 24, weight = 900, } ) surface.CreateFont( "Trebuchet22", { font = "Trebuchet MS", size = 22, weight = 900, } ) surface.CreateFont( "Trebuchet20", { font = "Trebuchet MS", size = 20, weight = 900, } ) surface.CreateFont( "Trebuchet19", { font = "Trebuchet MS", size = 19, weight = 900, } ) surface.CreateFont( "Trebuchet18", { font = "Trebuchet MS", size = 18, weight = 900, } ) surface.CreateFont( "HUDNumber", { font = "Trebuchet MS", size = 40, weight = 900, } ) surface.CreateFont( "HUDNumber1", { font = "Trebuchet MS", size = 41, weight = 900, } ) surface.CreateFont( "HUDNumber2", { font = "Trebuchet MS", size = 42, weight = 900, } ) surface.CreateFont( "HUDNumber3", { font = "Trebuchet MS", size = 43, weight = 900, } ) surface.CreateFont( "HUDNumber4", { font = "Trebuchet MS", size = 44, weight = 900, } ) surface.CreateFont( "HUDNumber5", { font = "Trebuchet MS", size = 45, weight = 900, } ) surface.CreateFont( "HudHintTextLarge", { font = "Verdana", size = 14, weight = 1000, antialias = true, additive = true, } ) surface.CreateFont( "HudHintTextSmall", { font = "Verdana", size = 11, weight = 0, antialias = true, additive = true, } ) surface.CreateFont( "CenterPrintText", { font = "Trebuchet MS", size = 18, weight = 900, antialias = true, additive = true, } ) surface.CreateFont( "DefaultFixed", { font = "Lucida Console", size = 10, weight = 0, } ) surface.CreateFont( "DefaultFixedDropShadow", { font = "Lucida Console", size = 10, weight = 0, shadow = true, } ) surface.CreateFont( "CloseCaption_Normal", { font = "Tahoma", size = 16, weight = 500, } ) surface.CreateFont( "CloseCaption_Italic", { font = "Tahoma", size = 16, weight = 500, italic = true, } ) surface.CreateFont( "CloseCaption_Bold", { font = "Tahoma", size = 16, weight = 900, } ) surface.CreateFont( "CloseCaption_BoldItalic", { font = "Tahoma", size = 16, weight = 900, italic = true, } ) surface.CreateFont( "TargetID", { font = "Trebuchet MS", size = 22, weight = 900, antialias = true, } ) surface.CreateFont( "TargetIDSmall", { font = "Trebuchet MS", size = 18, weight = 900, antialias = true, } ) surface.CreateFont( "BudgetLabel", { font = "Courier New", size = 14, weight = 400, outline = true, } ) surface.CreateFont( "JailBreakTitleFont", { font = "Chinese Rocks rg", size = 128, weight = 400, antialias = true, } ) surface.CreateFont( "JailBreakTitleFontLevel2", { font = "Chinese Rocks rg", size = 60, weight = 400, antialias = true, } ) surface.CreateFont( "JailBreakTitleFontSmall", { font = "Chinese Rocks rg", size = 100, weight = 400, antialias = true, } ) surface.CreateFont( "JailBreakTitleFontSmallest", { font = "Chinese Rocks rg", size = 40, weight = 400, antialias = true, } ) surface.CreateFont( "JailbreakMenuThingMainButton", { font = "Sports Jersey", size = 100, weight = 400, antialias = true, } ) -- entity -1585.3541 -359.9099 165.6040 -- cam -1581.458496 -396.353424 222.742065;setang 0.340060 89.003883 0.000000 JB.MainMenuEnabled = false; JB.MainMenuCharacterScreen = false; local function WorldToScreen(vWorldPos,vPos,aRot) local vWorldPos=vWorldPos-vPos; vWorldPos:Rotate(Angle(0,-aRot.y,0)); vWorldPos:Rotate(Angle(-aRot.p,0,0)); vWorldPos:Rotate(Angle(0,0,-aRot.r)); return vWorldPos.x/0.1,(-vWorldPos.y)/0.1; end local selectedTeam = "prisoner"; local preview local selection = 0; local prisoner = 1; local bg = surface.GetTextureID("vgui/background_texture") local lenOne = 36; local lenTwo = 36; local full = surface.GetTextureID("excljailbreak/full"); hook.Add("PostDrawTranslucentRenderables","123PostDrawLolMeowRgrg", function() if not JB.MainMenuEnabled then return end local mmp = MenuMain.pos+Vector(-113.3646, 45.0206, -93.8978); if not preview or not preview:IsValid() then preview = ents.FindByClass("jb_previewmodel")[1] end selection = 0; local pos = LocalPlayer():GetEyeTrace().HitPos; local xMouse, yMouse = WorldToScreen(Vector(pos.x,mmp.y,pos.z),mmp,Angle(0,0,90)); render.SetToneMappingScaleLinear(Vector(0.8,1,3)); cam.Start3D2D(mmp,Angle(0,0,90), .1); surface.SetDrawColor(200,200,200) surface.DrawRect(x-500,y-500,512*7,512*4); surface.SetDrawColor(255,255,255,200); surface.SetTexture(bg); for i=0,7 do for j=0,4 do surface.DrawTexturedRect(x-500+(i*512),y-500+(j*512),512,512); end end --#################### --## MAINMENU ## --#################### local MouseIsGood = (xMouse > x+1725 and xMouse < x+2275) draw.SimpleText("Welcome to Jailbreak3,", "HUDNumber5",x+2000,y,Color(0,0,0,255),1,0); draw.SimpleText(LocalPlayer():Nick(), "JailBreakTitleFont",x+2000,y+48,Color(0,0,0,255),1,0); draw.SimpleText("Select a team below", "HUDNumber5",x+2000,y+180,Color(0,0,0,255),1,0); local cA , cB , cC = Color(255,255,255,255),Color(255,255,255,255),Color(255,255,255,255); if not JB:CanBeGuard() then cB = Color(100,100,100,255); end if MouseIsGood and yMouse > y+230 and yMouse < y+330 then cA = Color(200,145,23,255); selection = 5; elseif MouseIsGood and yMouse > y+340 and yMouse < y+440 then if JB:CanBeGuard() then cB = Color(200,145,23,255); selection = 6; end elseif MouseIsGood and yMouse > y+450 and yMouse < y+550 then cC = Color(200,145,23,255); selection = 7; end surface.SetDrawColor(0,0,0) surface.DrawRect(x+1725,y+230,550,100); draw.SimpleText("Prisoners", "JailbreakMenuThingMainButton",x+2000,y+223,cA,1,0); surface.DrawRect(x+1725,y+340,550,100); draw.SimpleText("Guards", "JailbreakMenuThingMainButton",x+2000,y+333,cB,1,0); surface.DrawRect(x+1725,y+450,550,100); draw.SimpleText("Spectators", "JailbreakMenuThingMainButton",
Yea i am getting the same thing.
Your error is in the file gamemode/core/cl_spawnmenu.lua on line 404 - attempt to index field 'Players' (a nil value). I cannot see 'Players' anywhere in that code.... Line 404 of what you have pasted is "t = JB.Characters.Prisoner[prisoner];" Did you paste the right file?
Hey do you think you could post what should be in there and what to do about the hook.lua? 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
[QUOTE=wh1t3rabbit;40670532]Your error is in the file gamemode/core/cl_spawnmenu.lua on line 404 - attempt to index field 'Players' (a nil value). I cannot see 'Players' anywhere in that code.... Line 404 of what you have pasted is "t = JB.Characters.Prisoner[prisoner];" Did you paste the right file?[/QUOTE] [LUA]local x,y = -1000,-1200 surface.CreateFont( "DebugFixed", { font = "Courier New", size = 10, weight = 500, antialias = true, } ) surface.CreateFont( "DebugFixedSmall", { font = "Courier New", size = 7, weight = 500, antialias = true, } ) surface.CreateFont( "DefaultFixedOutline", { font = "Lucida Console", size = 10, weight = 0, outline = true, } ) surface.CreateFont( "MenuItem", { font = "Tahoma", size = 12, weight = 500, } ) surface.CreateFont( "Default", { font = "Tahoma", size = 13, weight = 500, } ) surface.CreateFont( "TabLarge", { font = "Tahoma", size = 13, weight = 700, shadow = true, } ) surface.CreateFont( "DefaultBold", { font = "Tahoma", size = 13, weight = 1000, } ) surface.CreateFont( "DefaultUnderline", { font = "Tahoma", size = 13, weight = 500, underline = true, } ) surface.CreateFont( "DefaultSmall", { font = "Tahoma", size = 1, weight = 0, } ) surface.CreateFont( "DefaultSmallDropShadow", { font = "Tahoma", size = 11, weight = 0, shadow = true, } ) surface.CreateFont( "DefaultVerySmall", { font = "Tahoma", size = 10, weight = 0, } ) surface.CreateFont( "DefaultLarge", { font = "Tahoma", size = 16, weight = 0, } ) surface.CreateFont( "UiBold", { font = "Tahoma", size = 12, weight = 1000, } ) surface.CreateFont( "MenuLarge", { font = "Verdana", size = 15, weight = 600, antialias = true, } ) surface.CreateFont( "ConsoleText", { font = "Lucida Console", size = 10, weight = 500, } ) surface.CreateFont( "Marlett", { font = "Marlett", size = 13, weight = 0, symbol = true, } ) surface.CreateFont( "Trebuchet24", { font = "Trebuchet MS", size = 24, weight = 900, } ) surface.CreateFont( "Trebuchet22", { font = "Trebuchet MS", size = 22, weight = 900, } ) surface.CreateFont( "Trebuchet20", { font = "Trebuchet MS", size = 20, weight = 900, } ) surface.CreateFont( "Trebuchet19", { font = "Trebuchet MS", size = 19, weight = 900, } ) surface.CreateFont( "Trebuchet18", { font = "Trebuchet MS", size = 18, weight = 900, } ) surface.CreateFont( "HUDNumber", { font = "Trebuchet MS", size = 40, weight = 900, } ) surface.CreateFont( "HUDNumber1", { font = "Trebuchet MS", size = 41, weight = 900, } ) surface.CreateFont( "HUDNumber2", { font = "Trebuchet MS", size = 42, weight = 900, } ) surface.CreateFont( "HUDNumber3", { font = "Trebuchet MS", size = 43, weight = 900, } ) surface.CreateFont( "HUDNumber4", { font = "Trebuchet MS", size = 44, weight = 900, } ) surface.CreateFont( "HUDNumber5", { font = "Trebuchet MS", size = 45, weight = 900, } ) surface.CreateFont( "HudHintTextLarge", { font = "Verdana", size = 14, weight = 1000, antialias = true, additive = true, } ) surface.CreateFont( "HudHintTextSmall", { font = "Verdana", size = 11, weight = 0, antialias = true, additive = true, } ) surface.CreateFont( "CenterPrintText", { font = "Trebuchet MS", size = 18, weight = 900, antialias = true, additive = true, } ) surface.CreateFont( "DefaultFixed", { font = "Lucida Console", size = 10, weight = 0, } ) surface.CreateFont( "DefaultFixedDropShadow", { font = "Lucida Console", size = 10, weight = 0, shadow = true, } ) surface.CreateFont( "CloseCaption_Normal", { font = "Tahoma", size = 16, weight = 500, } ) surface.CreateFont( "CloseCaption_Italic", { font = "Tahoma", size = 16, weight = 500, italic = true, } ) surface.CreateFont( "CloseCaption_Bold", { font = "Tahoma", size = 16, weight = 900, } ) surface.CreateFont( "CloseCaption_BoldItalic", { font = "Tahoma", size = 16, weight = 900, italic = true, } ) surface.CreateFont( "TargetID", { font = "Trebuchet MS", size = 22, weight = 900, antialias = true, } ) surface.CreateFont( "TargetIDSmall", { font = "Trebuchet MS", size = 18, weight = 900, antialias = true, } ) surface.CreateFont( "BudgetLabel", { font = "Courier New", size = 14, weight = 400, outline = true, } ) surface.CreateFont( "JailBreakTitleFont", { font = "Chinese Rocks rg", size = 128, weight = 400, antialias = true, } ) surface.CreateFont( "JailBreakTitleFontLevel2", { font = "Chinese Rocks rg", size = 60, weight = 400, antialias = true, } ) surface.CreateFont( "JailBreakTitleFontSmall", { font = "Chinese Rocks rg", size = 100, weight = 400, antialias = true, } ) surface.CreateFont( "JailBreakTitleFontSmallest", { font = "Chinese Rocks rg", size = 40, weight = 400, antialias = true, } ) surface.CreateFont( "JailbreakMenuThingMainButton", { font = "Sports Jersey", size = 100, weight = 400, antialias = true, } ) -- entity -1585.3541 -359.9099 165.6040 -- cam -1581.458496 -396.353424 222.742065;setang 0.340060 89.003883 0.000000 JB.MainMenuEnabled = false; JB.MainMenuCharacterScreen = false; local function WorldToScreen(vWorldPos,vPos,aRot) local vWorldPos=vWorldPos-vPos; vWorldPos:Rotate(Angle(0,-aRot.y,0)); vWorldPos:Rotate(Angle(-aRot.p,0,0)); vWorldPos:Rotate(Angle(0,0,-aRot.r)); return vWorldPos.x/0.1,(-vWorldPos.y)/0.1; end local selectedTeam = "prisoner"; local preview local selection = 0; local prisoner = 1; local bg = surface.GetTextureID("vgui/background_texture") local lenOne = 36; local lenTwo = 36; local full = surface.GetTextureID("excljailbreak/full"); hook.Add("PostDrawTranslucentRenderables","123PostDrawLolMeowRgrg", function() if not JB.MainMenuEnabled then return end local mmp = MenuMain.pos+Vector(-113.3646, 45.0206, -93.8978); if not preview or not preview:IsValid() then preview = ents.FindByClass("jb_previewmodel")[1] end selection = 0; local pos = LocalPlayer():GetEyeTrace().HitPos; local xMouse, yMouse = WorldToScreen(Vector(pos.x,mmp.y,pos.z),mmp,Angle(0,0,90)); render.SetToneMappingScaleLinear(Vector(0.8,1,3)); cam.Start3D2D(mmp,Angle(0,0,90), .1); surface.SetDrawColor(200,200,200) surface.DrawRect(x-500,y-500,512*7,512*4); surface.SetDrawColor(255,255,255,200); surface.SetTexture(bg); for i=0,7 do for j=0,4 do surface.DrawTexturedRect(x-500+(i*512),y-500+(j*512),512,512); end end --#################### --## MAINMENU ## --#################### local MouseIsGood = (xMouse > x+1725 and xMouse < x+2275) draw.SimpleText("Welcome to Jailbreak3,", "HUDNumber5",x+2000,y,Color(0,0,0,255),1,0); draw.SimpleText(LocalPlayer():Nick(), "JailBreakTitleFont",x+2000,y+48,Color(0,0,0,255),1,0); draw.SimpleText("Select a team below", "HUDNumber5",x+2000,y+180,Color(0,0,0,255),1,0); local cA , cB , cC = Color(255,255,255,255),Color(255,255,255,255),Color(255,255,255,255); if not JB:CanBeGuard() then cB = Color(100,100,100,255); end if MouseIsGood and yMouse > y+230 and yMouse < y+330 then cA = Color(200,145,23,255); selection = 5; elseif MouseIsGood and yMouse > y+340 and yMouse < y+440 then if JB:CanBeGuard() then cB = Color(200,145,23,255); selection = 6; end elseif MouseIsGood and yMouse > y+450 and yMouse < y+550 then cC = Color(200,145,23,255); selection = 7; end surface.SetDrawColor(0,0,0) surface.DrawRect(x+1725,y+230,550,100); draw.SimpleText("Prisoners", "JailbreakMenuThingMainButton",x+2000,y+223,cA,1,0); surface.DrawRect(x+1725,y+340,550,100); draw.SimpleText("Guards", "JailbreakMenuThingMainButton",x+2000,y+333,cB,1,0); surface.DrawRect(x+1725,y+450,550,100); draw.SimpleText("Spectators", "JailbreakMenuThingMainButton",x+2000,y+443,cC,1,0); if not JB:CanBeGuard() then surface.SetDrawColor(255,255,255
[QUOTE=Gryovex;40679012]Hey do you think you could post what should be in there and what to do about the hook.lua? 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183[/QUOTE] It has nothing to do with the hook.lua.
Sorry, you need to Log In to post a reply to this thread.