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

MoveEvent passage by kills

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
106
Location
Brazil
  • Made by: Mock
  • Tested on: TFS 0.3.6

With this script if you found a tile with aid 1010 only player tath kill more than 100 monster can pass
if change to 1001 only 10 monsters. 1011 is 110 :thumbup:

You can use it on quests etc.

Fisrt add this tag on creaturescripts.xml:
Code:
<event type="kill" name="monsterCounter" event="script" value="cont.lua"/>
And script:
Lua:
function onKill(cid, target)--- Script by mock
        if isMonster(target) then
             local s = math.max(0, tonumber(getPlayerStorageValue(cid,23483)))+1
	     setPlayerStorageValue(cid,23483,s)
	     addEvent(doPlayerSendTextMessage,100,cid,23,'You already killed 1'..(s)..' monsters')
        end 
	return true
end
If you dont use it on your server:
http://otland.net/f82/entavoid-use-registercreatureevent-login-lua-90268/
add it on login.lua
Code:
registerCreatureEvent(cid, "monsterCounter")
Now on movements.xml add tihs tag:
Code:
<movevent type="StepIn" itemid="415" event="script" value="counter.lua"/>
This script only work with itemid 415 and aid > 1000
if you want change itemid goahead :D
on counter.lua
Lua:
local aidToActive = 1000
local multipiler = 10
function onStepIn(cid, item, position, fromPosition) --Sctipy by mock
	if not isPlayer(cid) then return end
	if item.actionid > aidToActive then
		local l = (item.actionid-aidToActive)*multipiler
		local s = getPlayerStorageValue(cid,23483)
		s = s == -1 and 0 or s
		if s < l then
			doTeleportThing(cid,fromPosition,true)
			doPlayerSendTextMessage(cid,25,'Você precisa matar '..l..' monstros para entrar aqui!\nFaltam '..(l-s)..'.')
		end
	end
	return true
end
if you want change the multipiler to 1 and aid 1001 is 1 monster.
aid 2000 is 1000 monsters etc... :thumbup:

Enjoy
 
Last edited:
Where can i change monster that needs to be killed?.. Monster name.. ;x

thanks ;x
 
@Anco
on tile aid.
if you want pass only if you kill 800 monsters set tile aid to: 1080
and there is no monster name is to ALL monsters
 
Is it possible to edit the script so it's like tibia task system?

If i kill monster e.x Demon or Dragon 1k times, than i can pass that tile.


:p
 
i meant this
Code:
function onKill(cid, target, lastHit)--- Script by mock
	local s = math.max(0, getPlayerStorageValue(cid,23483))+1
	setPlayerStorageValue(cid,23483,s)
	doPlayerSendTextMessage(cid,23,'You already killed '..s..' monsters')
	return true
end
 
Very good script I'm sure there are lots of users that need this, but it
seems that if you kill a player it will also count as a 'Monster' kill,
just letting you know :D great script overall!
 
Very good script I'm sure there are lots of users that need this, but it
seems that if you kill a player it will also count as a 'Monster' kill,
just letting you know :D great script overall!

yeye, and summons
 
@Cykotitan and 375311
Yes but wath is better, kill a rat in swer or summon a fire elemental and spent mana? :eek:

If you got 5k of kills one player is nothing
 
Back
Top