Of course, the tool-gun is broken again.

There’s not really much to explain.

If I build for a while, tools will start switching randomly and then when I switch to another weapon it’ll just switch back to the toolgun… and the toolgun will start glitching again.

If I get rid of all my weapons and then spawn the toolgun again; it’s still broken.

Do you EVER test the updates when you release them?

I googled the problem, no success. The problem occurred after the new update.

To be honest, I’m tired of these constant bugs that prevent building and so on. I spent money on Garry’s Mod, and now that there’s SO MANY bugs, I feel like I want a refund. Please fix the toolgun bug or provide a helpful permanent fix. Any help would be appreciated.

I don’t see why you would need specs for this, But here you go:

┌ COMPUTER: 64-bit, not pre-built (I made it myself)
├ OS: Windows 7 Ultimate SP1 64bit
├ RAM: 14 GB
├┴ 10 GB PageFile (Basically, windows’ equivalent of linux’s swap data)
├┴ 4 GB Physical (RAM cards)
├ GPU: DirectX 9, Nvidia GeForce GT 640
├ CPU: AMD Athlon™ 5000 Dual-Core Processor
└┴ 2.21 GHz

I believe it’s not just me having this problem. When I googled it, I found answer-less steam community pages where people were angry with the same problem I had.

Bad tool-gun, bad!

Just a small recommendation; You might want to change the RAM requirement to 2.3 GB on the steam store page. (Unrelated, but oh well.)

No? Nobody? There’s no fix for this? Any help here?

Checking from a google, those tool gun problems happened in 2013 or early 2014 or less; around there. So, Maybe you are the only one, maybe you are not. This is not helpful, I understand, but it’s what I found.

Was the problem fixed? Can the problem be fixed? Is there anyone who fixed it?

The only changes I can think of that may have broken it is the gmod update and my upgrade to Windows 7 (I used to have Windows XP, But I paid for Windows 7 because Gmod runs like trash on XP)

There’s no reason for an OS upgrade to break something, but just in-case I verified my game cache. 2 files failed to verify but the problem still persists.

To be honest, I really need a fix about now. There’s some things I’ve been trying to build lately and it just doesn’t work because half way through building you need to use another tool and then your life is ruined by a LUA script.

Our server has this issue as well, it is very random and rather agitating.

This will be fixed in the next update.

Replace cl_init.lua in “garrysmod/garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/cl_init.lua” with this code.
It atleast fixed the problem on my server.


local gmod_drawhelp = CreateClientConVar( "gmod_drawhelp", "1", true, false )
local gmod_toolmode = CreateClientConVar( "gmod_toolmode", "rope", true, true )

cvars.AddChangeCallback( "gmod_toolmode", function( name, old, new )
	if ( old == new ) then return end
	spawnmenu.ActivateTool( new, true )
end, "gmod_toolmode_panel" )

include( "shared.lua" )
include( "cl_viewscreen.lua" )

SWEP.PrintName		= "Tool Gun"
SWEP.Slot			= 5
SWEP.SlotPos		= 6
SWEP.DrawAmmo		= false
SWEP.DrawCrosshair	= true

SWEP.WepSelectIcon = surface.GetTextureID( "vgui/gmod_tool" )
SWEP.Gradient = surface.GetTextureID( "gui/gradient" )
SWEP.InfoIcon = surface.GetTextureID( "gui/info" )

SWEP.ToolNameHeight = 0
SWEP.InfoBoxHeight = 0

surface.CreateFont( "GModToolName",
{
	font = "Roboto Bk",
	size = 80,
	weight = 1000
})

surface.CreateFont( "GModToolSubtitle",
{
	font = "Roboto Bk",
	size = 24,
	weight = 1000
})

surface.CreateFont( "GModToolHelp",
{
	font = "Roboto Bk",
	size = 17,
	weight = 1000
})

--[[---------------------------------------------------------
	Draws the help on the HUD (disabled if gmod_drawhelp is 0)
-----------------------------------------------------------]]
function SWEP:DrawHUD()

	local mode = gmod_toolmode:GetString()

	-- Don't draw help for a nonexistant tool!
	if ( !self:GetToolObject() ) then return end

	self:GetToolObject():DrawHUD()

	if ( !gmod_drawhelp:GetBool() ) then return end

	-- This could probably all suck less than it already does

	local x, y = 50, 40
	local w, h = 0, 0

	local TextTable = {}
	local QuadTable = {}

	QuadTable.texture = self.Gradient
	QuadTable.color = Color( 10, 10, 10, 180 )

	QuadTable.x = 0
	QuadTable.y = y - 8
	QuadTable.w = 600
	QuadTable.h = self.ToolNameHeight - ( y - 8 )
	draw.TexturedQuad( QuadTable )

	TextTable.font = "GModToolName"
	TextTable.color = Color( 240, 240, 240, 255 )
	TextTable.pos = { x, y }
	TextTable.text = "#tool." .. mode .. ".name"
	w, h = draw.TextShadow( TextTable, 2 )
	y = y + h

	TextTable.font = "GModToolSubtitle"
	TextTable.pos = { x, y }
	TextTable.text = "#tool." .. mode .. ".desc"
	w, h = draw.TextShadow( TextTable, 1 )
	y = y + h + 8

	self.ToolNameHeight = y

	QuadTable.y = y
	QuadTable.h = self.InfoBoxHeight
	local alpha =  math.Clamp( 255 + ( self:GetToolObject().LastMessage - CurTime() ) * 800, 10, 255 )
	QuadTable.color = Color( alpha, alpha, alpha, 230 )
	draw.TexturedQuad( QuadTable )

	y = y + 4

	TextTable.font = "GModToolHelp"
	
	if ( !self:GetToolObject().Information ) then
		TextTable.pos = { x + self.InfoBoxHeight, y  }
		TextTable.text = self:GetToolObject():GetHelpText()
		w, h = draw.TextShadow( TextTable, 1 )
		
		surface.SetDrawColor( 255, 255, 255, 255 )
		surface.SetTexture( self.InfoIcon )
		surface.DrawTexturedRect( x + 1, y + 1, h - 3, h - 3 )
		
		self.InfoBoxHeight = h + 8
		
		return
	end

	local h2 = 0

	for k, v in pairs( self:GetToolObject().Information ) do
		if ( type( v ) == "string" ) then v = { name = v } end

		if ( !v.name ) then continue end
		if ( v.stage && v.stage != self:GetStage() ) then continue end
		if ( v.op && v.op != self:GetToolObject():GetOperation() ) then continue end
	
		local txt = "#tool." .. GetConVarString( "gmod_toolmode" ) .. "." .. v.name
		if ( v.name == "info" ) then
			txt = self:GetToolObject():GetHelpText()
		end

		TextTable.text = txt
		TextTable.pos = { x + 21, y + h2 }

		w, h = draw.TextShadow( TextTable, 1 )
	
		if ( !v.icon ) then
			if ( v.name:StartWith( "info" ) ) then v.icon = "gui/info" end
			if ( v.name:StartWith( "left" ) ) then v.icon = "gui/lmb.png" end
			if ( v.name:StartWith( "right" ) ) then v.icon = "gui/rmb.png" end
			if ( v.name:StartWith( "reload" ) ) then v.icon = "gui/r.png" end
		end
		if ( !v.icon2 && v.name:EndsWith( "use" ) ) then v.icon2 = "gui/e.png" end
	
		self.Icons = self.Icons or {}
		if ( v.icon && !self.Icons[ v.icon ] ) then self.Icons[ v.icon ] = Material( v.icon ) end
		if ( v.icon2 && !self.Icons[ v.icon2 ] ) then self.Icons[ v.icon2 ] = Material( v.icon2 ) end

		if ( v.icon && self.Icons[ v.icon ] && !self.Icons[ v.icon ]:IsError() ) then
			surface.SetDrawColor( 255, 255, 255, 255 )
			surface.SetMaterial( self.Icons[ v.icon ] )
			surface.DrawTexturedRect( x, y + h2, 16, 16 )
		end

		if ( v.icon2 && self.Icons[ v.icon2 ] && !self.Icons[ v.icon2 ]:IsError() ) then
			surface.SetDrawColor( 255, 255, 255, 255 )
			surface.SetMaterial( self.Icons[ v.icon2 ] )
			surface.DrawTexturedRect( x - 25, y + h2, 16, 16 )
			
			draw.SimpleText( "+", "default", x - 8, y + h2 + 2, color_white )
		end

		h2 = h2 + h

	end

	self.InfoBoxHeight = h2 + 8

end

function SWEP:SetStage( ... )

	if ( !self:GetToolObject() ) then return end
	return self:GetToolObject():SetStage( ... )

end

function SWEP:GetStage( ... )

	if ( !self:GetToolObject() ) then return end
	return self:GetToolObject():GetStage( ... )

end

function SWEP:ClearObjects( ... )

	if ( !self:GetToolObject() ) then return end
	self:GetToolObject():ClearObjects( ... )

end

function SWEP:StartGhostEntities( ... )

	if ( !self:GetToolObject() ) then return end
	self:GetToolObject():StartGhostEntities( ... )

end

function SWEP:PrintWeaponInfo( x, y, alpha )
end

function SWEP:FreezeMovement()

	local mode = self:GetMode()
	
	if ( !self:GetToolObject() ) then return false end
	
	return self:GetToolObject():FreezeMovement()

end

function SWEP:OnReloaded()

	-- TODO: Reload the tool control panels
	-- controlpanel.Clear()

end