How to attach something on a bone?

Hello facepunch, I am making a GLaDOS entity, which is when he speaks to light a LED or a light (env_sprite), so good, it appears, but the problem is when to put this, modify the model to have a bone q of more, it appears, but when I place it, or this will not stay in place or not put into the bone, instead change depending on the angle q it is: S

Someone could give me a snippet to attach a bone, which is “light” and if not, I made an attachment which is “light_pos”

Here some pictures of what happens

Here the attachment code

[LUA]
if talk == 1 then
local BoneIndx = self.Entity:LookupBone(“light”)
local BonePos , BoneAng = self.Entity:GetBonePosition( BoneIndx )
self.led = ents.Create(“env_sprite”)
self.led:SetKeyValue(“model”,“sprites/blueflare1.spr”)
self.led:SetKeyValue(“scale”,“0.3”)
self.led:SetKeyValue(“rendermode”,“3”)
self.led:SetKeyValue(“rendercolor”,“255 255 0”)
self.led:SetPos(self.Entity:GetBonePosition( light ) + Vector(1.75,4.5,7))
self.led:SetParent(self.Entity)
self.led:Spawn()
self.led:Fire(“ShowSprite”,"",1)
end
[/LUA]

[editline]20th November 2011[/editline]

Other question,i can have 2 function separates?

like…

[LUA]
function Ent:Ontakedamage()
bla bla
end

function Ent:Ontakedamage()
derp derp dep
end[/LUA]

Why not just merge the two, and have one Ontakedamage() function?

Why are you using SetKeyValue for everything, and not just say,
self.led:SetRenderMode(3)

?