Garry's Mod Wiki

Revision Difference

util.PointContents#518731

<function name="PointContents" parent="util" type="libraryfunc"> <description>Returns the contents of the position specified.</description> <realm>Shared</realm> <args> <arg name="position" type="Vector">Position to get the contents sample from.</arg> </args> <rets> <ret name="" type="number">Contents bitflag, see <page>CONTENTS</page></ret>⤶ <ret name="" type="number">Contents bitflag, see <page>Enums/CONTENTS</page></ret>⤶ </rets> </function> <example> <description>Check if the trace position is underwater.</description> <code> local tr = Entity( 1 ):GetEyeTrace() print( bit.band( util.PointContents( tr.HitPos ), CONTENTS_WATER ) == CONTENTS_WATER ) </code> </example>