Entity.SetEyeTarget

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:SetEyeTarget( Vector targetPos )
Description:
In the case of a ragdoll, makes the ragdoll's eyes point toward the vector given.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetEyeTarget]Entity.SetEyeTarget [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionMakes all ragdolls in the map, look at you.
Used onNewerServer.png
Code
 
function ISaid( ply, text, team, death )
if (string.sub(text, 1, 9) == "lookatme!")  then
 
    for id,target in pairs(ents.FindByClass("prop_ragdoll")) do
 
        target:SetEyeTarget(ply:GetPos())
 
    end
end
hook.Add( "PlayerSay", "ISaid", ISaid );
 
 
OutputAll ragdolls in the map is looking at you.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox