NPC/Playermodel Bug

I am programming some cappies but i saw that my charachter has alienz eyes
==> http://prntscr.com/8ieeyf or http://i.imgur.com/WhRN6ui.jpg

Why are you constantly doing those things in a think hook?

I Dont know but thats not important! i am upgrading my old scripts …
But your answer doesnt explaining the black eye bug!

It’s because you are rotating the eyes.

i dont check your answer??
rotating wut?
in gmod 10 you could see the pretty eyes but now they are black!

Read the code; you are rotating the eyes 90 degrees

nono i rotating the hat 90 degress! not the eyes i just attach something to the attachment point called “eyes”.
And i get that error everytime on NPCs or Other players i think its a huge bug!

hmm its bugging without any reason on npcs and normal ragdolls!

You’re rotating the variable “TT” which is the angles of “k:GetAttachment(k:LookupAttachment(‘eyes’))”
You set TT in your code to “k:GetAngles()” and variable “k” is the eyes attachment.
You set the variable k.md to the hat entity you created.

You’re actually rotating the eyes.

wut i did it dont know wtf …
ok correcting that and sorry!

[editline]23rd September 2015[/editline]

uh fail
i dont rotate that
local TT = k:GetAngles()
TT:RotateAroundAxis(TT:Forward(),90)
TT:RotateAroundAxis(TT:Right(),90)
k.md:SetAngles(TT)
k.md:SetParent(k)
look
first i get the player angles in TT
then i am rotating the TT
and then i set k.md(the hat) angles! not the eyes!!

[editline]23rd September 2015[/editline]

i am just setting the hats position near the eyes
then i am rotating that
and then i am parenting it to the attachment
but if u want to rotate the eyes u have to rotate the BOne not the attachmetn!!!