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

How to..

UpAndDown

New Member
Joined
Mar 12, 2009
Messages
66
Reaction score
0
Some quick easy question, I want a monster to drop a key, but how do I make it so that it's key number 1500 for example?

I want the monster to have a drop rate of always, and then a key number to it.

Help will be rewarded with rep! ;)

Sincerely,
UpAndDown!
 
Open up your "kill.lua" found in "/data/creaturescripts/scripts/"
Then add:
Code:
function onDeath(cid, corpse, killer)
    local key = 2089 -- key number
    local creaturename = getCreatureName(cid)
    if creaturename == '[COLOR="Red"]demon[/COLOR]' then -- monster name
        local key = doAddContainerItem(corpse, key, 1)
        doSetItemActionId(key, [COLOR="Red"]6000[/COLOR]) -- action ID, same as door action ID
        setPlayerStorageValue(cid,4005,1)
    end
end
Then add this to your monster file
Code:
<script>
<event name="DoorKey"/>
</script>

Red Text
= What you must change
 
At the monster file;

<strategy attack="100" defense="0"/>
<script>
<event name="DoorKey"/>
</script>
<flags>

Just between those.
 
Back
Top