Garry's Mod

Garry's Mod

36 ratings
Random Entity Teleportation Location
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Roleplay
File Size
Posted
2.035 KB
9 Jun, 2024 @ 10:30am
1 Change Note ( view )

Subscribe to download
Random Entity Teleportation Location

Description
Lua-Script that teleports any entity to a random location on the map where there is a navigation mesh. To teleport an entity there are console commands.

Console commands (for any players):

entity_tele_random — Teleports an entity that is targeted by the player's scope to a random location on the map where there is a navigation mesh.

entity_tele_random_by_class "" — This command teleports any entity by class name: prop_physics, npc_alyx, and, and etc. Including all entities present on the map.

entity_tele_random_by_name "" — This command teleports an entity to a random location on the map where there is a navigation mesh, but teleports by the entity's target name. If the entity has a target name set. For example, npc_alyx has a target name of Alyx, then this command teleports the entity by the value of Alyx. You must enter the command: entity_tele_random_by_name Alyx — in the console to teleport this entity.

The TargetName of any entity can be set via the console command: ent_setname "TargetName".

After teleporting the entity to a random location, the player who entered the command will see information in chat and console about the coordinates where the entity was teleported to.

If there is no navigation mesh on the map, you can create it yourself:

nav_generate — Generates a navigation mesh for the current map and saves it to disk.

nav_analyze — Analyzes, checks and resaves the navigation mesh file to disk in the map folder with the name of your map.
4 Comments
timox 12 Jun, 2024 @ 5:48pm 
youre the best
Gurt 9 Jun, 2024 @ 12:02pm 
how is this on most popular with 0 stars
BombChecker87 9 Jun, 2024 @ 11:44am 
This makes npc chases 1000x scarier, thanks!
0303 9 Jun, 2024 @ 11:19am 
Cool