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

chenge storage and action id by kill monster

zielq701

New Member
Joined
Jul 15, 2010
Messages
4
Reaction score
0
Hello! I don't know how to make script:
If player use item (grave), it will summon creature and change actionid of item, then if player kill monster actionid back to normal, and player's storage value will change ... (3rd mission of inq).

I was trying do it, but that don't work:

actions/scripts:

thecount.lua
Code:
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,200000) == 10 and item.actionid == 39996 then
   doSummonCreature("The Count", {x= 32783,y=31966,z=9})
   doSetItemActionId(item.uid, 39995)
elseif item.actionid == 39995 then
doCreatureSay(cid, "Its empty.", TALKTYPE_ORANGE_1)
end
return true
end

creaturescripts:

The Count.lua
Code:
local pos = {x=32782, y=31996, z=9, stackpos=0}
function onKill(cid, target, lastHit)
if getPlayerStorageValue(cid,200000) == 10 then
setPlayerStorageValue(cid, 200000, 11)
doSetItemActionId(pos, 39996)
elseif getPlayerStorageValue(cid,200000) < 10 or getPlayerStorageValue(cid,200000) > 10 then
doSetItemActionId(pos, 39996)
end 
    return TRUE     
end

in monster file:
the count.xml i added this:
Code:
      <script>
        <event name="The Count"/>
    </script>

Please help me ;d.
 
Back
Top