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

CreatureEvent Killed monsters counter!

not explain excuse me! example: i kill 5 dragons and deslogueo and enter and kill 1 dragon! you have a 6 kill dragons! that have formed andalusia desloguiar the counter is set to zero to reset the account?

"sorry I do not speak English very well" :s

What he means is he wants the counter to be reset when you logout. For example if you use a war server where multiple people use one character, you wouldn't want the same count if you were using this for a quest. People would get free quest completion. He needs a script for onLogout that sets the storage value to -1, that's all.
 
Dunno if limit is 65535, its propably 2,147,483,647

For showing message:

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")

to
Code:
if(killed == 1 or killed == 100 or killed % 1000 == 0) then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
end


[17/06/2009 23:31:21] data/creaturescripts/scripts/monster_counter.lua:20: attempt to perform arithmetic on global 'killed' (a nil value)
[17/06/2009 23:31:21] stack traceback:
[17/06/2009 23:31:21] data/creaturescripts/scripts/monster_counter.lua:20: in function <data/creaturescripts/scripts/monster_counter.lua:11>

:<
 
works perfect but ...

how to not add summons ?


tried to change here but did not work

........
if(isPlayer(target) ~= TRUE) then
........
To
........
if(isPlayer(target) ~= TRUE and getCreatureSummons(target) ~= TRUE) then
........

any better ideas? :huh:
 
does not work for me, tfs 0,2,4 ;s

23:33 You deal 17 damage to a rotworm.
23:33 You deal 48 damage to a rotworm.
23:34 Loot of a rotworm: a bag, 23 gold coins, 6 worms, 21 gold coins, ham, meat.
 
Okay, i made it for 451 monsters, but.. there's a problem.. ONLY THE 6 first monsters it says you have killed: x monsters, all the other doesn't.. why :(?

Highest storage value is: (I begun with 35001)
PHP:
["Zevelon Duskbringer"] = 35451,

Plax help :(, if somebody helps, I'll share my list with 451 monsters!
 
Last edited:
All screenshots were hosted on site which is gone now, thats weird (noone can't see it in action before dowloading).

Anyway, just fixed bug with summons (they shouldn't be counted).

@Winnerandy
Thats because monster names must be written lowercase (dragon NOT Dragon).
 
This looks like a nice script, would it be possible for anyone to advance the script to show certain monster-stats upon looking on the monster if you have > 100 kills?
 
possible, and (quite) easy using source edit(but needs big table storing storages used for each monster in source or external file loaded on startup)
 
possible, and (quite) easy using source edit(but needs big table storing storages used for each monster in source or external file loaded on startup)

I was hoping with just lua/xml.
Why would it need more storing than the StorageValues? I mean, this lua-script stores how many monsters a player kills by StorageValue which is already saved in database?
 
I've red the script , idk if I got it correctly , but what will happen if the counter reaches some kind of limit or something , cuz it probably isn't endless ...
So,

What is the limit [if there is any] , and what happens when it's reached?
 
I've red the script , idk if I got it correctly , but what will happen if the counter reaches some kind of limit or something , cuz it probably isn't endless ...
So,

What is the limit [if there is any] , and what happens when it's reached?
Limit is 99999999999999 :/

99999999999999 + 1 = 1e+14 :/

Nothing happens, it just won't display count properly :p
 
Limit is 99999999999999 :/

99999999999999 + 1 = 1e+14 :/

Nothing happens, it just won't display count properly :p

Hmm, if count reachs 99999999999999 make new counter in another storage then display sum of both?
 
Hmm, if count reachs 99999999999999 make new counter in another storage then display sum of both?
:eek::eek::eek::O unb&

but amm, it won't work - lua can't return or handle numbers higher than that. :/
 
you first must make sure that SQL can handle such numbers :p

ow, it can
PHP:
	`value` VARCHAR(255) NOT NULL DEFAULT '0'
 
Back
Top