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

Help (A)

Djivar

AKA Wickedviruz
Joined
Sep 28, 2009
Messages
1,641
Reaction score
20
Location
Sweden,edsbyn
I need help with make a script that when you kill x monster you can walk thru x door,

rep+ if helping
 
use onKill or onDeath(easier is onKill I guess)(its creaturescript if you dont know...)
and just give storage
if you will give value 1 you can use normal sealed door script(dont remember how it work but its easy to figure out by opening script)

you can use some scripts that exists on forum to see what parameters and what order of them to use if you dont know

And remember, it WAS help
 
Not tested!

LUA:
 function onDeath(cid, corpse, killer)
   local monster = getCreatureName(cid)
   local behemoth = getPlayerStorageValue(killer, 5572)
     if (monster == 'behemoth') then

doPlayerSendTextMessage(killer,MESSAGE_STATUS_CONSOLE_BLUE,'You can now enter the door.')
setPlayerStorageValue(killer,5572, 1)

         else
       end
 end

That will make playerstorage if killed a behemoth. Now it's just to make a door!
 
I know, but the door needs an id to, what id whould that be? should it be 5573 ?


And when i killed the monster this error come up

PHP:
[29/03/2010 17:47:50] Lua Script Error: [CreatureScript Interface] 
[29/03/2010 17:47:50] data/creaturescripts/scripts/gilderwand.lua:onDeath

[29/03/2010 17:47:50] luaGetPlayerStorageValue(). Player not found

[29/03/2010 17:47:50] Lua Script Error: [CreatureScript Interface] 
[29/03/2010 17:47:50] data/creaturescripts/scripts/gilderwand.lua:onDeath

[29/03/2010 17:47:50] luaDoPlayerSendTextMessage(). Player not found

[29/03/2010 17:47:50] Lua Script Error: [CreatureScript Interface] 
[29/03/2010 17:47:50] data/creaturescripts/scripts/gilderwand.lua:onDeath

[29/03/2010 17:47:50] luaDoPlayerSetStorageValue(). Player not found
 
Code:
local config = {
	monster = 'Behemoth',
	storage = 5572,
	message = 'You can now enter the door.'
}
function onDeath(cid, corpse, deathList)
	if getCreatureName(cid):lower() == config.monster:lower() then
		for i = 1, #deathList do
			if isPlayer(deathList[i]) and getPlayerStorageValue(deathList[i], config.storage) < 1 then
				doPlayerSendTextMessage(deathList[i],MESSAGE_EVENT_ADVANCE, config.message)
				setPlayerStorageValue(deathList[i], config.storage, 1)
			end
		end
	end
	return true
end
 
Back
Top