• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

mining script resp help

MadMOOK

Hoo
Joined
Apr 20, 2011
Messages
802
Reaction score
43
in the mines... when a dwarf dies on top of remains of gold ore, it doesnt remove the remains and the big stone comes back with the remains on top of it so u cant mine it again...
So my question is, how do i remove the dwarf bodies WITH the remains of gold ore?
Code:
 function dostoneReturn(itemposition,oldid)
local pos = getThingfromPos(itemposition)
  doTransformItem(pos.uid,oldid)
  doSetItemText(pos.uid, getItemNameById(oldid))
  doSendMagicEffect(itemposition,math.random(28,30))
end
 
Use getTileItemById.
Code:
doTransformItem(getTileItemById(itemposition, 2160).uid, oldid)
Change 2160 to the id of the item that should transform.
 
it is between 11539 and 11538, is there a wayto use both item id's in that line?
@Limos


If not its cool too, i can just use the 1 type of remains xD ty limos
 
Last edited:
You can check if they exist.
Code:
local thing = getTileItemById(itemposition, 11539).uid
if thing > 0 then
    doTransformItem(thing, oldid)
end
And do the same thing for the other one.

Or where the function is used, add the id there as extra parameter, same as the oldid.
Code:
function dostoneReturn(itemposition, oldid, id)
    doTransformItem(getTileItemById(itemposition, id).uid, oldid)
-- blabla


addEvent(dostoneReturn, 60 * 1000, itemposition, oldid, id)
I assume the function is used in addEvent.
 
Back
Top