• player_extension.lua:65: attempt to index global 'server_settings'=nil.
    5 replies, posted
Hey Guys. I get that lua error sandbox\gamemode\player_extension.lua:65: attempt to index global 'server_settings'a nil value I cannot find the part of my script who makes that error [lua] // The Concommands for Easily Settings local Can_Trail = CreateClientConVar("Can_Trail",1,false,true) local Can_Trail_Color_r = CreateClientConVar("Can_Trail_Color_r",255,false,true) local Can_Trail_Color_g = CreateClientConVar("Can_Trail_Color_g",255,false,true) local Can_Trail_Color_b = CreateClientConVar("Can_Trail_Color_b",255,false,true) local Can_Trail_Color_a = CreateClientConVar("Can_Trail_Color_a",255,false,true) local Can_Trail_Texture = CreateClientConVar("Can_Trail_Texture","trails/plasma.vmt",false,true) local Can_Trail_Startsize = CreateClientConVar("Can_Trail_Startsize",15,false,true) local Can_Trail_Endsize = CreateClientConVar("Can_Trail_Endsize",1,false,true) local Can_Trail_Lifetime = CreateClientConVar("Can_Trail_Lifetime",12,false,true) local Can_Texture = CreateClientConVar("Can_Texture","Can/PopCan01a.vmt",false,true) local Can_Say = CreateClientConVar("Can_Say","1",false,true) if (SERVER) then CreateConVar('sbox_maxpopcans', 20) end //infos TOOL.Category = "Construction" TOOL.Name = "#Can Spawner" TOOL.Command = nil TOOL.ConfigName = "" //Languages if (CLIENT) then language.Add("Tool_can_name","PopCan Stool V1.2") language.Add("Tool_can_desc","Spawns a Popcan on a Prop and Welds it. Version 1.2 ") language.Add("Tool_can_0","Leftclick: Spawns a Popcan and Welds it.") language.Add("Undone_can","Undone a Can") language.Add("SBoxLimit_popcans", "You've hit the Popcan limit!") end //leftclick function TOOL:LeftClick( tr ) //Lets Spawn it local Can_Texture = Can_Texture:GetString() local ply = self:GetOwner() local Trace = tr.Entity local Pos = tr.HitPos if !ply:CheckLimit("popcans") then return end local ent = ents.Create ("prop_physics") ent:SetModel ("models/props_junk/PopCan01a.mdl") ent:SetMaterial(Can_Texture) ent:SetPos( Pos ) ent:SetAngles(tr.HitNormal:Angle()) ent:Spawn() ent:SetSolid(SOLID_NONE) ply:AddCount("popcans", ent) //WELD local weld = constraint.Weld( tr.Entity, ent, tr.PhysicsBone, 0, 0 ) //Undo Things undo.Create( "popcan" ) undo.AddEntity( weld ) undo.AddEntity( ent ) undo.SetPlayer( ply ) undo.Finish() // The Trail Part local TrailColor_r = Can_Trail_Color_r:GetString() local TrailColor_g = Can_Trail_Color_g:GetString() local TrailColor_b = Can_Trail_Color_b:GetString() local TrailColor_a = Can_Trail_Color_a:GetString() local TrailTexture = Can_Trail_Texture:GetString() local TrailStartsize = Can_Trail_Startsize:GetString() local TrailEndsize = Can_Trail_Endsize:GetString() local TrailLifetime = Can_Trail_Lifetime:GetString() //Set The Trail to The Prop if (Can_Trail:GetInt() == 1) then local trail = util.SpriteTrail(ent, 0, Color( TrailColor_r, TrailColor_g, TrailColor_b, TrailColor_a ), false, TrailStartsize, TrailEndsize, TrailLifetime, 1/(15+1)*0.5, TrailTexture) else return false end end // Panel. function TOOL.BuildCPanel( panel ) panel:AddControl( "Header", { Text = "CanSpawnSettings" } ) local params = {Label = "CanSpawnSettings"} //Gives the can, if sv_cheats 1 is enabled panel:AddControl("Button", { Label = "Give CanSpawner. Requires sv_cheats 1", Description = "Gives a Player the CanSpawner Requires sv_cheats 1", Text = "Give Canspawner. Requires sv_cheats 1", Command = "give can", }) //The Crank Say panel:AddControl( "CheckBox", { Label = "Can_Say ? Careful, It Spams your Console and your chat.", Command = "Can_Say" } ) //Enables or Disables the Trails panel:AddControl( "CheckBox", { Label = "Trails?", Command = "Can_Trail" } ) //The 3 Cans. Lets do It! list.Set( "Can_Texture", "Can1", "models/props_junk/PopCan01a.vmt" ) list.Set( "Can_Texture", "Can2", "models/props_junk/PopCan02a.vmt" ) list.Set( "Can_Texture", "Can3", "models/props_junk/PopCan03a.vmt" ) panel:MatSelect( "Can_Texture", list.Get( "Can_Texture" ), true, 0.25, 0.25 ) //Trail_Lifetime, Start-End Size panel:NumSlider( "Startize", "Can_Trail_Startsize", 0, 128, 2 ) panel:NumSlider( "EndSize", "Can_Trail_Endsize", 0, 128, 2 ) panel:NumSlider( "Lifetime", "Can_Trail_Lifetime", 0, 128, 2 ) //ColorPick panel:AddControl( "Color", { Label = "Trail-Color", Red = "Can_Trail_Color_r", Green = "Can_Trail_Color_g", Blue = "Can_Trail_Color_b", ShowAlpha = "0", ShowHSV = "1", ShowRGB = "1", Multiplier = "255" } ) //Trails Material. Copy Paste from the Trails.lua list.Set( "Can_Trail_Texture", "#Plasma", "trails/plasma.vmt" ) list.Set( "Can_Trail_Texture", "#Tube", "trails/tube.vmt" ) list.Set( "Can_Trail_Texture", "#Electric", "trails/electric.vmt" ) list.Set( "Can_Trail_Texture", "#Smoke", "trails/smoke.vmt" ) list.Set( "Can_Trail_Texture", "#Laser", "trails/laser.vmt" ) list.Set( "Can_Trail_Texture", "#PhysBeam", "trails/physbeam.vmt" ) list.Set( "Can_Trail_Texture", "#Love", "trails/love.vmt" ) list.Set( "Can_Trail_Texture", "#LoL", "trails/lol.vmt" ) panel:MatSelect( "Can_Trail_Texture", list.Get( "Can_Trail_Texture" ), true, 0.25, 0.25 ) panel:NumSlider( "MaxPopcans you must be Admin...", "Sbox_Maxpopcans", 0, 128, 0 ) end [/lua] please help me greetings
What's your gamemode's folder called?
sandbox... i did not changed the name of the gamemode. _ You see, its a STool. And if i Leftclick, that error comes. But everything works. I get only the Error Message.
It's from your stool's LeftClick [lua] if !ply:CheckLimit("popcans") then return end [/lua] Add this line above it: [lua] if(CLIENT) then return end [/lua]
I Love you <3 Thank you, it Works !
Sorry, you need to Log In to post a reply to this thread.