• STool lua help
    4 replies, posted
After reading this tutorial: [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexa2e7.html?title=Basic_STOOL[/url] This is the finished product of the basicness. I wanted to test if the tool shows up and exc, and it does except one issue. The commands that they use entity_editor_color_r, entity_editor_color_g, entity_editor_color_b, entity_editor_color_a, entity_editor_bool, entity_editor_number are producing an "Unknown Command" error any time i edit the color picker, or modify the other values. So used [BTOOL.ClientConVar][/B] to set the variables. And wala still error. Any help would be appreciated, thanks :) [lua] TOOL.Category = "Ugleh" TOOL.Name = "#Entiny Editor" TOOL.Command = nil TOOL.ConfigName = "" TOOL.ClientConVar[ "entity_editor_color_r" ] = "" TOOL.ClientConVar[ "entity_editor_color_g" ] = "" TOOL.ClientConVar[ "entity_editor_color_b" ] = "" TOOL.ClientConVar[ "entity_editor_color_a" ] = "" if SERVER then end if ( CLIENT ) then language.Add( "Tool_entity_editor_name", "Entity Editor" ) language.Add( "Tool_entity_editor_desc", "Edit Entity properties." ) language.Add( "Tool_entity_editor_0", "Left click to grab the entitys name" ) end function TOOL:LeftClick( trace ) end function TOOL:RightClick( trace ) end function TOOL.BuildCPanel( panel ) panel:AddControl("Header", { Text = "Entity Editor TOOL", Description = "Entity Editor Menu" }) panel:AddControl("CheckBox", { Label = "A Boolean Value", Command = "entity_editor_bool" }) panel:AddControl("Slider", { Label = "Example Number", Type = "Float", Min = "0", Max = "10000", Command = "entity_editor_number" }) panel:AddControl("Color", { Label = "A Color", Red = "entity_editor_color_r", Blue = "entity_editor_color_b", Green = "entity_editor_color_g", Alpha = "entity_editor_color_a", ShowHSV = 1, ShowRGB = 1, Multiplier = 255 }) end [/lua]
I think you need to restart GMod if it says Unknown Command in the chatbox. After, it will show you an actual lua error.
Im not sure if those are outdated, besides, that STOOL isn't quite complete yet, i think thats more of a template, so it could just be showing it cause of the rest of the code needs to be added? well thats a guess
Restarted and I still see errors, idk whats up with it. Anyone see anything wrong with it? When i try to edit the color: Unknown command: entity_editor_color_r Unknown command: entity_editor_color_g Unknown command: entity_editor_color_b Unknown command: entity_editor_color_a Unknown command: entity_editor_color_r Unknown command: entity_editor_color_g Unknown command: entity_editor_color_b Unknown command: entity_editor_color_a m
I changed the top to this: local entity_editor_bool = CreateClientConVar("entity_editor_bool", "0", true, false) local entity_editor_number = CreateClientConVar("entity_editor_number", "0", true, false) local entity_editor_color_r = CreateClientConVar("entity_editor_color_r", "0", true, false) local entity_editor_color_g = CreateClientConVar("entity_editor_color_g", "0", true, false) local entity_editor_color_b = CreateClientConVar("entity_editor_color_b", "0", true, false) local entity_editor_color_a = CreateClientConVar("entity_editor_color_a", "0", true, false) It removed the error but now it seams that SetColor is local or something because when i person colors the same object it changes for them but not for me.
Sorry, you need to Log In to post a reply to this thread.