Kod :
<movevent type="RemoveItem" itemid="2345" event="script" value="removeblock.lua"/>
Kod :
function onRemoveItem(moveItem, tileItem, position, cid)
local BadGroundNames = {"shallow water", "swamp"}
local GroundPosition = {x = position.x, y = position.y, z = position.z, stackpos=0}
local Ground = getTileThingByPos(position).itemid
if(isInArray(BadGroundNames, getItemNameById(Ground), true)) then
doRemoveItem(moveItem.uid, 1)
doItemSetAttribute(doPlayerAddItem(cid, moveItem.itemid, 1), "uid", moveItem.uid)
end
return true
end
Nie w pełni działająca wersja, gdyż nie kopiuje uid itema. Spróbuj samodzielnie to naprawić, ja dziś nie dam rady.
Zakładki