SetActorShop
Makes an actor a vendor - the use key on it opens the shop.
The actor shows “Trade” under its name within reach and the use key opens the shop on the player, on the
game’s own trade screen (SetShopScreen keeps the panel; OnPlayerInteractActor and OnPlayerOpenShop may stop
it). The screen closes when the player walks 4 m from the actor or it dies. nil takes the shop off (the screens on it
close). A vendor is not invulnerable by itself: SetActorInvulnerable - or make it with CreateVendor, which does both.
Syntax
Section titled “Syntax”SetActorShop(id, shop)| Parameter | Type | |
|---|---|---|
id |
number | the actor |
shop |
number | nil | the shop; nil = none |
Returns
Section titled “Returns”boolean - false for anything but an actor, or no such shop
Example
Section titled “Example”local store = CreateShop("General store", 0.5, 500)SetShopItem(store, "torch_weapon", 5)local merchant = CreateActor(nil, x, y, z, 180, "Merchant", nil, "none")SetActorInvulnerable(merchant, true)SetActorShop(merchant, store)See also
Section titled “See also”GetActorShop · CreateVendor · CreateShop · OpenShop · SetActorPrompt · SetActorInvulnerable · the NPC actors group of the index
