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

XPRIMEX

Semi-Dead
Joined
Jun 19, 2012
Messages
293
Reaction score
14
Hey, this is just a very simple script I made. if you need anything changed withing it simply go to my REQUEST thread by clicking the link below

Picklocking System : > HERE < (Request Thread)
Description : When the picklock (set id to your comfort) is used on a closed
door there is a XX% that the door will be unlocked or that your pick will break
and the door remain Locked



Picklocking System

Actions.xml
Lua:
<action itemid="5941" event="script" value="picklocksystem1.lua"/>

PicklockingSystem.lua
Lua:
---Picklock System
--By XPRIMEX
--A HUUUUUGE thanks to Evan
-- Edit The Ids to your pleasure :P


	function onUse(cid, item, fromPosition, itemEx, toPosition)
		local chance = math.random (1,100)
		if item.itemid == 5941 and itemEx.itemid == 1213 then
			if itemEx.actionid == 1213 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

thanks for helping me out Evan :p

- - - How To Use It :- - -

Place action id 1213 on the item you put in this line :
Lua:
if item.itemid == 5941 and itemEx.itemid == 1213 ---Here

Change this to make the picklocking easire/harder
Lua:
if chance <= 90 then

the doors will relock after it is closed.

REPP ++ Evan + Me if u'll be using it


Le system in action
UTmNg.png

ctt8Co.png
 
Last edited:

Teckman

Intermediate OT User
Joined
Jul 5, 2008
Messages
913
Reaction score
147
Seems pretty nifty for an RPG server, I do like how you made it for one door only rather than every locked door.

What the fuck man? Do you have any permission to use your avatar or signature? I didn't grant it for sure.

@ontopic

The whole idea seems cool, but I don't think it fits the Tibia.
 

Advent

Custom RPG Maker
Joined
Oct 3, 2009
Messages
306
Reaction score
7
I am making it for my server as well but it will be like 1000x more advanced and counting as skill. Anyway, cool script.
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,515
Solutions
46
Reaction score
1,091
Location
Arica - Chile
What the fuck man? Do you have any permission to use your avatar or signature? I didn't grant it for sure.

@ontopic

The whole idea seems cool, but I don't think it fits the Tibia.

I think the same, but then I think on a quest with this system :)
 

Teckman

Intermediate OT User
Joined
Jul 5, 2008
Messages
913
Reaction score
147
I think the same, but then I think on a quest with this system :)

If used in a quest i.e. "Lockpicker quest", "Thieves Guild" and so on it would be awesome AND combined with lockpick sprite would be just uber awesome. :D

I am making it for my server as well but it will be like 1000x more advanced and counting as skill. Anyway, cool script.

Don't make it too advanced. :D :D :D
 

Advent

Custom RPG Maker
Joined
Oct 3, 2009
Messages
306
Reaction score
7
Well it will be skill which can be trained in something like thieves guild. Also you use lockpick item. There will be dungeon chests, locked doors, basements which can be opened by someone with certain level of lockpicking. While you are succeding, you gain experience in this skill and improving it. It will be interesting choice in matter which skill/profession I should learn/become.
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
How can i add more ids to work with more doors with the same pick lock? xD
This should work. :)

added some prints so it's easier to test.

Lua:
local lockpicks = {
    --[[
    [lockpickId] = {
        doors = {
            [doorActionId] = {door = doorId, transformTo = doorTransformId, chance = chance/100}
        }
    },
    
    ]]--
    [5941] = {
        doors = {
            [1213] = {door = 1213, transformTo = 1214, chance = 50}
        }
    }
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

    local index = lockpicks[item.itemid]
    if not index then
        print("Lockpick doesn't exist in table.")
        return true
    end
    
    index = index.doors[itemEx.itemid]
    if not index then
        print("This door doesn't have an actionid that matches this lockpick.")
        return true
    end
    
    if index[1] ~= itemEx.itemid then
        print("This door is already unlocked? itemid doesn't match.")
        return true
    end


    local chance = math.random(100)
    if chance > index[3] then
        print("lockpicking failed.")
        doPlayerRemoveItem(cid, item.itemid, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You failed to pick the lock and broken your pick in the attempt.")
        return true
    end
    
    print("lockpicking successful.")
    doTransformItem (itemEx.uid, index[2])
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The door has been unlocked!")
    return true
end
 

Sotomayor

New Member
Joined
Jan 28, 2012
Messages
62
Reaction score
4
Thanks for support me bro, i already test but appears this
Lua:
This door is already unlocked? itemid doesn't match.
 
Last edited:

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
Thanks for support me bro, i already test but appears this
Lua:
This door is already unlocked? itemid doesn't match.
Yeah, sorry about that.
I changed the table at the last minute, but forgot to update the table references through-out the script. xD

This should work.
Lua:
local lockpicks = {
    --[[
    [lockpickId] = {
        doors = {
            [doorActionId] = {door = doorId, transformTo = doorTransformId, chance = chance/100}
        }
    },
    
    ]]--
    [5941] = {
        doors = {
            [1213] = {door = 1213, transformTo = 1214, chance = 50}
        }
    }
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    
    local index = lockpicks[item.itemid]
    if not index then
        print("Lockpick doesn't exist in table.")
        return true
    end
    
    index = index.doors[itemEx.itemid]
    if not index then
        print("This door doesn't have an actionid that matches this lockpick.")
        return true
    end
    
    if index.door ~= itemEx.itemid then
        print("This door is already unlocked? itemid doesn't match.")
        return true
    end
    
    
    local chance = math.random(100)
    if chance > index.chance then
        print("lockpicking failed.")
        doPlayerRemoveItem(cid, item.itemid, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You failed to pick the lock and broken your pick in the attempt.")
        return true
    end
    
    print("lockpicking successful.")
    doTransformItem (itemEx.uid, index.transformTo)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The door has been unlocked!")
    return true
end
 
Top