Hello, otland
I need one thing more in this script.
It's possible when you open the door(need key) and stop by her close automatically? Like exp door.
I need one thing more in this script.
It's possible when you open the door(need key) and stop by her close automatically? Like exp door.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local chance = math.random (1,100)
if item.itemid == 2088 and itemEx.itemid == 1213 then
if itemEx.actionid == 1213 then
if chance <= 99 then
doTransformItem (itemEx.uid, 1214) ---Door Id
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The door has been unlocked !")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You failed to pick the lock and broken your pick in the attempt.")
doPlayerRemoveItem(cid, 2088, 1)
end
end
end
return true
end