Basically I am trying to remove specific toolguns, I scrambled a code which I believe would work, but I dont seem to know the right way to do this.
my code:
local function ToolRemoval()
for k, v in pairs( g_SpawnMenu.ToolMenu.Items ) do
if ( v.Tab:GetText() == language.GetPhrase("tool.axis.name") ) then
g_SpawnMenu.ToolMenu:CloseTab( v.Tab, true )
ToolRemoval()
end
end
end
hook.Add("SpawnMenuOpen", "removeTools", ToolRemoval)
I get no errors with this, which made me go here to ask for your guys' help
(I believe) you need to manually remove from through the base gamemode I could be wrong.
I dont want to remove the toolguns from the gamemode, I know that this is a valid option, but I would like to go by a script method
I know it is late but I still work on this. However, I managed to get DCollapsibleCategory's of toolmenu. Dunno if it helps but this code gets them;
for _,v in pairs(g_SpawnMenu.ToolMenu.Items) do
if (v.Name == "#spawnmenu.tools_tab") then
for __,_v in pairs(v.Panel:GetChildren()[1]:GetChildren()[2]:GetChildren()[1]:GetChildren()) do
for ___,__v in pairs(_v:GetList():GetChildren()) do
if ___==1 then
for ____,___v in pairs(__v:GetChildren()) do
-- I dont know what to do
end
end
end
end
end
end
Sorry, you need to Log In to post a reply to this thread.