Yalasari
Active Member
- Joined
- Jul 16, 2017
- Messages
- 82
- Solutions
- 8
- Reaction score
- 46
Hi, i have this piece of code:
I want to count how many kongra u killed (until number of kills reach 100) it's like task system, this piece of code is edited piece of "Killing in the name of..." quest, while abovementioned quest works, this script doesn't, Script is loaded but not working (function onKill isn't called), I registered event in login.lua and added in creaturescripts.xml, version is TFS 1.2
Thanks in advance for help.
Lua:
broadcastMessage('script loading', MESSAGE_STATUS_WARNING)
function onKill(player, target)
broadcastMessage('onkill activated', MESSAGE_STATUS_WARNING)
if(player:getStorageValue(72003) == 1) then
if target:isPlayer() or target:getMaster() then
return true
end
broadcastMessage('questactive', MESSAGE_STATUS_WARNING)
local targetName = target:getName():lower()
if targetName == "kongra" then
broadcastMessage('it is kongra', MESSAGE_STATUS_WARNING)
local killAmount = player:getStorageValue(70001)
if killAmount < 100 then
broadcastMessage('added...', MESSAGE_STATUS_WARNING)
player:setStorageValue(70001, 10 + 1)
end
end
end
return true
end
I want to count how many kongra u killed (until number of kills reach 100) it's like task system, this piece of code is edited piece of "Killing in the name of..." quest, while abovementioned quest works, this script doesn't, Script is loaded but not working (function onKill isn't called), I registered event in login.lua and added in creaturescripts.xml, version is TFS 1.2
Thanks in advance for help.