Garry's Mod Wiki

util.IsInWorld

  boolean util.IsInWorld( Vector position )

Description

Checks if a certain position is within the world bounds.

Arguments

1 Vector position
Position to check.

Returns

1 boolean
Whether the vector is in world.

Example

Here's a trick you can do to achieve the behavior of this function on the client.

(This may be less efficient than the serverside function itself)

local tr = { collisiongroup = COLLISION_GROUP_WORLD, output = {} } function util.IsInWorld( pos ) tr.start = pos tr.endpos = pos return not util.TraceLine( tr ).HitWorld end