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

Solved Why this counter doesn't work?

therrax

Member
Joined
Jul 12, 2012
Messages
262
Solutions
1
Reaction score
11
TFS 0.3.7

Why this counter from task system doesn't work?

creaturescripts/killinginthenameof:
Code:
function onKill(cid, target, lastHit)

local started = getPlayerStartedTasks(cid)
if isPlayer(target) or isSummon(target) then return true end
if started and #started > 0 then
for _, id in ipairs(started) do
if isInArray(tasks[id].creatures, getCreatureName(target):lower()) then
if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) < 0 then
doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, 0)
end
if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) < tasks[id].killsRequired then
doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, getCreatureStorage(cid, KILLSSTORAGE_BASE + id) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getCreatureStorage(cid, KILLSSTORAGE_BASE + id) .. "/" .. tasks[id].killsRequired .. " " .. tasks[id].raceName .. " already killed.")
end
end
end
end
return true
end
Code:
<event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
login.lua:
Code:
    registerCreatureEvent(cid, "KillingInTheNameOf")
 
What happens, do you get errors? Do you have the function isSummon?
You can check if there is something wrong with that fuction by removing that part to see if it does anything then.
 
@Limos
I don't have errors. I will check it.
_______
I checked it, when I delete this part it works, but I have to replace it? :
Code:
 or isSummon(target)
 
Back
Top