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

Solved Kill Monster door unlocks

Puncker

Member
Joined
Nov 29, 2008
Messages
170
Reaction score
6
Hello, i am just wondering if there's a way to make it so if you kill monster a door unlocks, im trying to do this for my INQ quest because i can't get the teleport working where you kill x monster and a teleport is created, i have tried a few scripts and none are working, so now im trying to get it so if you kill x monster it unlocks x door so you can open it and walk through the teleport, can anyone help me out?
 
as you couldn't setup the inquisition portals creaturescript, you probably won't know how to setup this either

if you're using an onDeath kind of script, it should be registered for every inquisition boss
with onKill, only in login.lua
 
Not tested but should work

data/creaturescripts/scripts/login.lua
Lua:
registerCreatureEvent(cid, "OpenSesame")

data/creaturescripts/creaturescripts.xml
XML:
<event type="kill" name="OpenSesame" event="script" value="script.lua"/>

data/creaturescripts/scripts/script.lua
Lua:
local t = {
	["demon"] = {
		storage = 12345,
		door = {
			8541, -- Locked DoorId
			{x = 100, y = 100, z = 7} -- Where the Door is located
		}
	}
}
 
function onKill(cid, target, damage, flags)
	local k = t[string.lower(getCreatureName(target))]
	if(k and (damage == true or bit.band(flags, 1) == 1) and isMonster(target)) then
		if(getCreatureStorage(cid, k.storage) < 0) then
			local door = getTileItemById(k.door[2], k.door[1])
			if(door.uid > 0) then
				doTransformItem(door.uid, item.itemid + 1)
				doCreatureSetStorage(cid, k.storage, 1)
			end
		end
	end
	return true
end
 
Last edited:
Thanks guys, i ended up getting the INQ portals working, but thanks for the door script as well, it will give me some other ideas for quests :)
 
You can just add a new part/line for the other monsters in the local t, it will look for the name of the monster.
If you remove the enters it's probable more easy to understand.
Code:
  ["demon"] = {storage = 12345, door = {8541, {x = 100, y = 100, z = 7}}}
You can can just add more of those lines under it, don't forget to add a comma at the end of every line except from the last one.
 
Back
Top