I created a pillar that uses it to rotate I'm using the decay function is working the problem is that sometimes the pillar starts to rotate very fast as if the decay had a shorter time
in items.xml
<attribute key="duration" value="900" />
Code:
local transformTo = {
[36309] = 36310,
[36310] = 36311,
[36311] = 36312,
[36312] = 36309
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if isInArray(transformTo, item.itemid) then
local pilar = transformTo[item.itemid]
if pilar then
item:decay()
item:transform(pilar)
item:getPosition():sendMagicEffect(CONST_ME_POFF)
end
end
return true
end
in items.xml
<attribute key="duration" value="900" />