Code:
function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingfromPos(position)
position.stackpos = STACKPOS_TOP_FIELD
local field = getThingfromPos(position)
if item.uid ~= thing.uid and thing.itemid >= 100 or field.itemid ~= 0 then
return FALSE
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = -1
if isSorcerer(cid) then
voc = 1
elseif isDruid(cid) then
voc = 2
elseif isPaladin(cid) then
voc = 3
elseif isKnight(cid) then
voc = 4
elseif isRookie(cid) then
voc = 0
end
if item.actionid >= 8000 and item.actionid <= 8005 then
if item.actionid == 8000+voc then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return TRUE
end
return FALSE
end
i have this script is work but if u stay in door and use in door itemid transform to +1 and door is broken please help i rep ++