Assim
local config = {
fromPosition = {x = 856, y = 785, z = 7}, -- começo da area
toPosition = {x = 876, y = 810, z = 7}, -- fim da area
}
if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
doPlayerAddItem(cid, item, count)
end
ou assim:
local config = {
fromPosition = {x = 856, y = 785, z = 7}, -- começo da area
toPosition = {x = 876, y = 810, z = 7}, -- fim da area
}
for x = config.fromPosition.x, config.toPosition.x do
for y = config.fromPosition.y, config.toPosition.y do
for z = config.fromPosition.z, config.toPosition.z do
area = {x = x, y = y, z = z, stackpos = 253}
allplayers = getThingfromPos(area)
if isPlayer(allplayers.uid) then
doPlayerAddItem(cid, item, count)
end
end
end
end
pra ve se tem monsters e so trocar o isPlayer por isMonster