How to do something on pressing E on an entity?

How do I make it so that when pressing E on a entity, it gets automatically flipped over and put in the right place? I want this only to happen to one entity.

http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf0f2.html ~ trigger

Trace = player:GetEyeTraceNoCursor()
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexacfb-2.html ~ traces

or

http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index555c.html ~ custom entity

then

http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index8d72.html ~ set prop angle

those should help, not sure exactly what you want to give an example

[lua]–Untested:
function ENT:Use( activator, caller )
if ( activator:IsPlayer() ) then
Entity:SetPos( Vector(0,0,0) )
Entity:SetAngles( Angle(0,90,0) )
end
end[/lua]

Thanks to both of you! I’ll figure it out!

The code I posted should go within the entity you want to apply this to. I believe it goes in the shared file.

I got it, but after setting position, it freezes there…how do i activate physics on it so it falls back to the ground?

local phys = Ent:GetPhysicsObject()
phys:EnableMotion(true)

if i recall Ent:PhysWake() makes sure it is moving again after being frozen