Rider Ones
New Member
- Joined
- Jan 12, 2009
- Messages
- 104
- Reaction score
- 2
Hello dear players i get this error when kill trolls i have started a task
This is my scripts:
And dont get Questlog
HELP??
Lua:
[20/3/2017 14:14:59] [Error - CreatureScript Interface]
[20/3/2017 14:14:59] data/creaturescripts/scripts/killinginthenameof.lua:onKill
[20/3/2017 14:14:59] Description:
[20/3/2017 14:14:59] data/creaturescripts/scripts/killinginthenameof.lua:3: attempt to call global 'getPlayerStartedTasks' (a nil value)
[20/3/2017 14:14:59] stack traceback:
[20/3/2017 14:14:59] data/creaturescripts/scripts/killinginthenameof.lua:3: in function <data/creaturescripts/scripts/killinginthenameof.lua:1>
This is my scripts:
Lua:
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
And dont get Questlog
HELP??