• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Killed monsters counter!

restart of the counter is possible to logout? someone could edit the eScrip for that pls :s
 
Its a great script, but can you erase the msg (when killing monster) and to know the quantity of monsters you have to do a talkaction?
 
[08/04/2009 16:56:12] data/creaturescripts/scripts/monster_counter.lua:12: attempt to call global 'isMonster' (a nil value)
[08/04/2009 16:56:12] stack traceback:
[08/04/2009 16:56:12] data/creaturescripts/scripts/monster_counter.lua:12: in function <data/creaturescripts/scripts/monster_counter.lua:11>

???
 
omfg it works :D

I used for my tfs 0.3(beta3) this first script, and all works :)

TY
 
Last edited:
Cayzon said:
Uuuuh, nice script but doesn't work for me.. The counter is working but no creatures are dying when they die, they are just standing there, impossible to attack them and no hp bar ^^
What's the problem? (I use TFS 0.3)

It work perfectly for me with TFS 0.3.3..
 
for 0,2 you must use isPlayer FALSE

Hmm, yeah I never thought about it.

[
Updated! (Fixed bug in console)​
]

#Edit
Argh.. it wasn't bug, as event is registered only for players. Reverted changes.
 
Last edited:
[08/04/2009 16:56:12] data/creaturescripts/scripts/monster_counter.lua:12: attempt to call global 'isMonster' (a nil value)
[08/04/2009 16:56:12] stack traceback:
[08/04/2009 16:56:12] data/creaturescripts/scripts/monster_counter.lua:12: in function <data/creaturescripts/scripts/monster_counter.lua:11>




help plx i pay rep++ xd
 
WTF with PLAYER FALSE? I don't understand it...
Can someone give me a line with the right code?
 
Ohhh, I didn't saw it :p Now its perfectly working, thank you ;) +rep for a great script!
 
I have a question:

If i want to use this for a quest... I want it to start count when i have a certain storage, and end when it has another storagevalue. I made the script by editing urs, but i get an error:
Code:
...lua:36 ')' is expected near 'spearman'


Here is my script:
Code:
local monsters = {
	--name = storage
	["rotworm"] = 35001,
	["orc"] = 35002,
	["orc spearman"] = 35003,
	["orc warrior"] = 35004,
}
local name = getCreatureName(target)
local monster = monsters[string.lower(name)]

function onKill(cid, target)
	if(isPlayer(target) ~= TRUE) then
    if(monster) then


      if getPlayerStorageValue(cid, 30101) == 1 then
        if getPlayerStorageValue(cid, rotworm) == -1 then
          if setPlayerStorageValue(cid, rotworm, 1) == TRUE then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed " .. getPlayerStorageValue(cid, rotworm) .. " " .. name .. ".")
          end
        elseif getPlayerStorageValue(cid, rotworm) >= 1 and getPlayerStorageValue(cid, rotworm) <= 20 then
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed " .. getPlayerStorageValue(cid, rotworm) .. " " .. name .. "'s.")
          setPlayerStorageValue(cid, monster, getPlayerStorageValue(cid, rotworm) + 1)
        end
      end


      if getPlayerStorageValue(cid, 30102) == 1 then
        if getPlayerStorageValue(cid, orc) == -1 then
          if setPlayerStorageValue(cid, orc, 1) == TRUE then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed " .. getPlayerStorageValue(cid, orc) .. " " .. name .. ".")
          end
        elseif getPlayerStorageValue(cid, orc) >= 1 and getPlayerStorageValue(cid, orc) <= 12 then
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed " .. getPlayerStorageValue(cid, orc) .. " " .. name .. "'s.")
          setPlayerStorageValue(cid, monster, getPlayerStorageValue(cid, orc) + 1)
        end
        [COLOR="Red"]if getPlayerStorageValue(cid, orc spearman) == -1 then
[/COLOR]          if setPlayerStorageValue(cid, orc spearman, 1) == TRUE then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed " .. getPlayerStorageValue(cid, orc spearman) .. " " .. name .. ".")
          end
        elseif getPlayerStorageValue(cid, orc spearman) >= 1 and getPlayerStorageValue(cid, orc spearman) <= 6 then
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed " .. getPlayerStorageValue(cid, orc spearman) .. " " .. name .. "'s.")
          setPlayerStorageValue(cid, monster, getPlayerStorageValue(cid, orc spearman) + 1)
        end
        if getPlayerStorageValue(cid, orc warrior) == -1 then
          if setPlayerStorageValue(cid, orc warrior, 1) == TRUE then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed " .. getPlayerStorageValue(cid, orc warrior) .. " " .. name .. ".")
          end
        elseif getPlayerStorageValue(cid, orc warrior) >= 1 and getPlayerStorageValue(cid, orc warrior) <= 2 then
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed " .. getPlayerStorageValue(cid, orc warrior) .. " " .. name .. "'s.")
          setPlayerStorageValue(cid, monster, getPlayerStorageValue(cid, orc warrior) + 1)
        end
      end



    end
	end
	return TRUE
end
 
@slawkens
I got this error in console.
[17/05/2009 10:24:00] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/monster_counter.lua
[17/05/2009 10:24:00] data/creaturescripts/scripts/monster_counter.lua:1: '=' expected near 'monsters'

NEVERMIND! I FIXED IT. XD
 
"Congratulation you killed your " .. name .. " number " .. killedMonsters .. " ."

I think this is better ;)

Congratulation you killed your Dragon number 100.
 
Back
Top