- 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"/>
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
http://otland.net/f82/entavoid-use-registercreatureevent-login-lua-90268/
add it on login.lua
Code:
registerCreatureEvent(cid, "monsterCounter")
Code:
<movevent type="StepIn" itemid="415" event="script" value="counter.lua"/>
if you want change itemid goahead
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
aid 2000 is 1000 monsters etc... :thumbup:
Enjoy
Last edited: