DarkRP Printers - Putting a On/Off button on them

I have no idea where to start. How would i put a button on the entity which turns it on and off. Thanks

Well, that’s a solution, but I’d make that for you in let’s say less that a hour. That’s realy simple.



local pressed
function ENT:Draw()
	self:DrawModel()
	local flag = self:GetNWBool("PrinterActive")
	local pos = self:LocalToWorld(Vector(0, 0, 0)) // enter local pos of your screen on the entity	
	local angs = self:GetAngles()
	// Use RotateArroundAxis(angs:Right/angs:Up/angs:Forward, degrees /*usualy 90/-90/180/-180*/)
	cam.Start3D2D(pos, angs, 0.1)
		local x, y = gui.MousePos()
		local butW = 128
		local butH = 32
		local butX = 0
		local butY = 0
		if (x >= butX && x <= (butX + butW)) then
			if (input.IsButtonDown(MOUSE_LEFT) || input.IsButtonDown(MOUSE_RIGHT)) then
				draw.RoundedBox(8, butX, butY, butW, butH, Color(0, 0, 255, 128))
				pressed = true
			else
				draw.RoundedBox(8, butX, butY, butW, butH, Color(133, 133, 133, 128))
			end
		else
			if (flag) then
				draw.RoundedBox(8, butX, butY, butW, butH, Color(0, 255, 0, 128))
			else
				draw.RoundedBox(8, butX, butY, butW, butH, Color(255, 0, 0, 128))
			end			
		end		
	cam.End3D2D()
	
	if (!input.IsButtonDown(MOUSE_LEFT) && !input.IsButtonDown(MOUSE_RIGHT) && pressed) then
		//Actualy call a code to toggle on/off your printer !
	end
end


Not enough time to make the server part, sorry… In fact that has been made in 2 minutes…