• 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!

Solved Deacy doesn't work?

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,300
Location
Sweden?
Hello everyone,

Why doesnt this work?

It create the item, but it doesn't decay. It getting stuck on 10min!

LUA:
        local pos = {x=1000,y=1000,z=7}
	local poscheck = getTileItemById(pos, 10288).uid
	local decaycreate = doCreateItem(10288,1,pos)
	
	if poscheck == 0 then
		doDecayItem(decaycreate)
	else
		doRemoveItem(poscheck)
		doDecayItem(decaycreate)
	end
 
Last edited:
anyways, i want to see if it movements, global, creature part of code, idk
and id = 10288?
i dont have any servers to test..
 
well, 0.2.14 svn
XML:
        <item id="7359" article="a" name="flame of life">
                <attribute key="decayTo" value="7360" />
                <attribute key="duration" value="360" />
                <attribute key="showduration" value="1" />
        </item>
        <item id="7360" article="a" name="flame of life">
                <attribute key="decayTo" value="0" />
                <attribute key="duration" value="60" />
                <attribute key="showduration" value="1" />
        </item>

also adding stackpos? (stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE)
 
well, 0.2.14 svn
XML:
        <item id="7359" article="a" name="flame of life">
                <attribute key="decayTo" value="7360" />
                <attribute key="duration" value="360" />
                <attribute key="showduration" value="1" />
        </item>
        <item id="7360" article="a" name="flame of life">
                <attribute key="decayTo" value="0" />
                <attribute key="duration" value="60" />
                <attribute key="showduration" value="1" />
        </item>

also adding stackpos? (stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE)

Im using 0.3.7. Idk if that matters.
 
LUA:
	local pos, poscheck, itemm = {x = 1000, y = 1000, z = 7, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, getThingFromPos(pos), 7256
	if poscheck.itemid == 0 then
		doDecayItem(doCreateItem(itemm, pos))
	else
		doRemoveItem(poscheck.uid)
		doDecayItem(doCreateItem(itemm, pos))
	end

it works for me (itemm = 7256, cus i edited a dead braindeath corpse)
 
FFS, my fault!!!! omg!!!! FFS! I forgot to put decayto at items.xml :S!!!

Between i get error on decay. I think its because if the items getting removed and the decay is still on, it cant find that item.

Thanks StreamSide :)
 
Back
Top