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

[REQUEST] Kill monster add storage.

Ezzam

New Member
Joined
Jan 16, 2008
Messages
213
Reaction score
2
Code:
function onDeath(cid, corpse, killer)
local storage1 = getPlayerStorageValue(killer, 30101)
local storage2 = getPlayerStorageValue(killer, 35001)
local monster = getCreatureName(cid)
local MONSTERNAME = rotworm

  if storage1 == 1 then
    if monster == MONSTERNAME then
      if storage2 < 0 and storage2 < 1 then
        setPlayerStorageValue(killer, storage2, 1)
        doPlayerSendTextMessage(killer,22,"You have killed 1 ".. monster ..".")
      elseif storage2 >= 0 and storage2 <= 18 then
        setPlayerStorageValue(killer, storage2 + 1)
        doPlayerSendTextMessage(killer,22,"You have killed ".. storage2 + 1 .." ".. monster .."s.")
      elseif storage2 >= 0 and storage2 <= 90 then
        setPlayerStorageValue(killer, storage2 + 1)
        doPlayerSendTextMessage(killer,22,"You have killed enough ".. monster .."s.")
      end
    end
  end
  return true
end

Script is still bugged, no error. But wont work.
 
Last edited:
Firstly, some info/tips ;p

All, what is inside function onDeath() is really executed when someone die.
All what is declared above this function, is just const, which will never change.

You know 'cid' only in function onDeath(cid, ...) so you can't use it outside this function.

So, move getCreature name etc, these declarations into onDeath function

PS. getPlayerStorageValue(cid, storage)

Do what I said and post, we'll see more later ;)
 
Back
Top