Skip to content

GetHerbsNear

The picked spots and the mode’s herbs within a circle, nearest first.

GetHerbsNear(x, y, z, radius, max)
Parameter Type
x number metres
y number metres
z number metres
radius number metres
max number the most to list (optional, 100; up to 1000)

table - a list of {key, kind, x, y, z, radius, picked, by, regrowIn, created}: picked whether it is taken now, by the picker’s name (empty for the mode’s), regrowIn the real seconds until it grows back (-1 never on its own, 0 when not picked), created whether it is a herb of the mode’s

local x, y, z = GetPlayerPos(pid)
for _, h in ipairs(GetHerbsNear(x, y, z, 30)) do
if h.picked then SendClientMessage(pid, COLOR_WHITE, h.kind .. " picked by " .. h.by) end
end

ResetHerb · CreateHerb · the Herbs and mushrooms group of the index