CarryEntity
Has a player carry an NPC actor’s body - or a dead player’s corpse - the mode’s own order.
id is the entity: an NPC actor (CreateActor) - dead or alive; a living one shows knocked out for the carry and wakes after
it, unless the mode knocked it out (SetActorKnockedOut) - or the entity of a dead player’s corpse (the body that stays when
[combat] corpse_seconds is above 0; a corpse’s entity id is the entityId the server logs, and shows in GetEntities as an
NPC). The carrier is checked as in CarryPlayer (dead or not in the world, on horseback, in a cart, flying, in a dice match,
in a fall or a pull-down, knocked out, already carrying or carried, in a fight, at a shop, in a dialogue) and the speed is
CarryPlayer’s too. The body must be in the carrier’s virtual world and view, within six metres, and not carried, carrying,
seated on a cart or (a corpse) being searched; an animal cannot be carried. Works with the players’ own grab switched off.
Syntax
Section titled “Syntax”CarryEntity(carrier, id [, speed])| Parameter | Type | |
|---|---|---|
carrier |
number | the player who carries |
id |
number | the entity |
speed |
number | the carrier’s pace in m/s; nil = the rules’ speed (optional) |
Returns
Section titled “Returns”boolean, string - true when the grab started; false and the reason when it did not
Example
Section titled “Example”-- /drag: carry the nearest NPC actor within reachlocal id = GetNearestEntity(pid, ENTITY_NPC, 4)if id then local ok, why = CarryEntity(pid, id) if not ok then SendClientMessage(pid, COLOR_RED, why) endendSee also
Section titled “See also”CarryPlayer · StopCarry · SetEntityCarryable · ActorCarryEntity · the Carrying group of the index
