Entity.Visible

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:Visible( Entity eOtherEnt )
Description:
Returns true if this entity can "see" the second entity, and false otherwise. See additional notes for important information on this function.
Returns: Boolean
In Object: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.Visible]Entity.Visible [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionColors a SENT red if Player 1 cannot "see" it. Colors the SENT green if Player 1 can "see" it.
Used onNewerServer.png
Code
 
if !self:Visible(player.GetByID(1)) then
    self:SetColor(255,0,0);
else
    self:setColor(0,255,0);
end
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox