← Previous | Next →
surround
Description
Positions the NPC around a specified entity, calculating an offset based on the number of people surrounding and the NPC's position among them.
Name | Type | Possibilities |
surround | behaviour | 1 |
Parameters
# | Name | Type | Mandatory | Description | Multiple |
1 | entity | Entity | Yes | The entity to surround. | No |
2 | people | integer | Yes | The total number of people surrounding the entity. | No |
3 | position | integer | Yes | The position of the NPC among the people surrounding the entity (1-based index). | No |
4 | radius | number | Yes | The radius of the circle formed by the surrounding people. | No |
Outputs
# | Description |
1 | The NPC has moved to the designated position and is now facing the entity. |
Example
NPC
name Guard1
model s_m_m_security_01
position -1020.72 4839.78 258.30 0.0
interaction
nothing
behaviour
getClosestPlayer player 15
surround $player 3 1 5.0
NPC
name Guard2
model s_m_m_security_01
position -1018.72 4839.78 258.30 0.0
interaction
nothing
behaviour
getClosestPlayer player 15
surround $player 3 2 5.0
NPC
name Guard3
model s_m_m_security_01
position -1022.72 4839.78 258.30 0.0
interaction
nothing
behaviour
getClosestPlayer player 15
surround $player 3 3 5.0