Skip to content

CreateHerb

Plants a herb of the mode’s - the kind’s plant with a “Pick” prompt, wherever the mode wants it.

The plant stands where the mode puts it, for every player in the virtual world world (0 by default). The use key on it picks it: OnPlayerPickHerb is asked (its radius is 0), the player gets the kind’s item (or the mode’s amount), and the plant is gone for everyone until the kind’s regrow time runs out or ResetHerb brings it back. There is no gathering animation (play an emote from the callback if you want one). RemoveHerb takes it away for good. Up to 2000. Needs the meshes of the server’s tables export.

CreateHerb(kind, x, y, z, yaw, world)
Parameter Type
kind string the item name or its class GUID
x number metres
y number metres
z number metres (on the ground)
yaw number degrees (optional)
world number the virtual world (optional)

string - the herb’s key, or nil and the reason

-- a herb garden behind the apothecary
for i = 0, 4 do CreateHerb("herb_salvia", 640 + i * 1.5, 3302, 146.2, i * 70) end

RemoveHerb · OnPlayerPickHerb · the Herbs and mushrooms group of the index