What am I doing wrong with these player commands?

OK I was trying to amke it where players automatically retrieved laser sights and other stuff on guns on spawn, but it doens’t appear to be working.


		//timer.Create("attach", 1, 1, function()
		ply:ConCommand("cstm_pimpmygun 5")


I tried mutiple things and none of them worked.

What are we supposed to do with this tiny, tiny cut out of your code?

Sorry I was busy working on multiple things and forgot to mention where I got this from.

It came from this: http://forum.facepunch.com/showthread.php?t=1268158

Let me explain what everything does, and maybe it will help people help me.

OK basically this console command “cstm_requestpimp”, opens the menu for the attachements to be attached.

This command “cstm_pimpmygun 5”, will actually attach them to the gun. The number tot he right of it tells you what attachment you are attaching. The thing is the menu mus be open in order for this command to work, from my experience.

This command “ply:PickUpAttachment(“aimpoint”)”, Gives the player a aimpoint scope.

When I tried to emulate the same thing in lua it did not work though.