Skip to content

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.

SetActorShop(id, shop)
Parameter Type
id number the actor
shop number | nil the shop; nil = none

boolean - false for anything but an actor, or no such shop

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)

GetActorShop · CreateVendor · CreateShop · OpenShop · SetActorPrompt · SetActorInvulnerable · the NPC actors group of the index