• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Use tile than -> You have found a Silver Key

Blue Identity

Member
Joined
Feb 20, 2009
Messages
174
Reaction score
15
Location
Netherlands
Hello Supporters,

I want, as in real tibia, to place the Silver Key in the Necromant House. This key will give you the acces to the closed door and the teleport behind it.
How can I make it so ones used the tile you will find that sertain item (a key in this case) but it will also have a action ID, see the red text in the script.

Code:
 function onUse(cid, item, frompos, item2, topos)

local config = {
        storage = 16025, -- change to your own storage value :)
        item = 2088, [COLOR="#FF0000"]This item needs action ID: 3701[/COLOR]
		

}

        if getPlayerStorageValue(cid, config.storage) == -1 then
                setPlayerStorageValue(cid, config.storage, 1)
				doPlayerSendTextMessage(cid,25,"You have found a silver key.")
                key = doPlayerAddItem(cid, config.item, 1)
        else
                doPlayerSendTextMessage(cid,25,"The tile is empty.")
                end
        return TRUE
end

Thanks lots :)
 
go to ur map, set action id.

go to actions.xml, config there.

u dont have to set actionid on the script, but the item id

LUA:
local config = {
    storage = 16025, -- change to your own storage value :)
    item = 2088  -- THIS IS THE ITEM ID (KEY)
}

function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid, config.storage) == 1 then
		doPlayerSendTextMessage(cid, 25, "The tile is empty.")
		return true
	end
	
	setPlayerStorageValue(cid, config.storage, 1)
	doPlayerSendTextMessage(cid, 25, "You have found a silver key.")
	doPlayerAddItem(cid, config.item, 1)
	return true
end
 
Thanks for your reply but isnt that imposible to do since I want to make the key lootable from a tile? Means when he clicks on the floor he gets the key so I cannot at a actionID on or select a key via the mapeditor.
 
Thanks for your reply but isnt that imposible to do since I want to make the key lootable from a tile? Means when he clicks on the floor he gets the key so I cannot at a actionID on or select a key via the mapeditor.

What you just said makes no sense, restate that please.
 
What do you mean it makes no sense?

When player uses a sertain floor tile he will get the key (see script).
Now I know there must be placed something in the script that gives the lootable quest item a sertain actionID but I don't know what it is.
Thats the question, how to add actionIDs and uIDs on mapeditor is crystal clear for me.
 
You mean the script that I posted myself in the first place?

Please read over...

When a player uses a ground tile for example grass... grass <>click<> You have found a key. That part is what I had already in my first post.

BUT the key must have a sertain actionID to open a door.. So somewhere in the script there must be dosetitemActionID "3701" or something like that. Its impossible to add that actionID via the mapeditor since the item is lootable from a tile so you cannot add a item or actionID on that tile as you can on a chest...
 
Back
Top