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

Picklocking doesnt work

Webtimize

Pro Grammer
Joined
Oct 3, 2011
Messages
491
Solutions
10
Reaction score
182
Location
Hell
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
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,
 
You have to register the id of the picklock tool not the unique id of the door.
 
Thanks, it is working now. But before i have to picklock the door, it has to be locked, but i can open the door without that picklock, how do i fix that?
 
Back
Top