Hey peeps,
I tried to implement the picklocking script by xprimex, but its not working.
I've edited it a bit, so it would be working with an unique ID, but i am 0.001% skilled in LUA..
The door is suppose to be item id 6257, the stake is 5941 and the unique ID of the door is 8991.
When i use the stake on the door, nothing happens, and i get; "You cannot use that object".
picklock.lua
actions.xml
Please, tell me what i do wrong, and maybe correct it for me.
Thanks alot!
Yours,
I tried to implement the picklocking script by xprimex, but its not working.
I've edited it a bit, so it would be working with an unique ID, but i am 0.001% skilled in LUA..
The door is suppose to be item id 6257, the stake is 5941 and the unique ID of the door is 8991.
When i use the stake on the door, nothing happens, and i get; "You cannot use that object".
picklock.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local chance = math.random (1,100)
if item.itemid == 5941 and itemEx.itemid == 6257 then
if itemEx.uid == 8991 then
if chance <= 50 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, 5941, 1)
end
end
end
return true
end
actions.xml
Code:
<action uniqueid="8991" event="script" script="picklock.lua"/>
// edited this like i saw it in the actions.xml file..
Please, tell me what i do wrong, and maybe correct it for me.
Thanks alot!
Yours,