Hello I am currently getting some kind of errors when using my script.
This is the script:
And the error i'm getting is:
[26/02/2015 02:48:45] [Error - CreatureScript Interface]
[26/02/2015 02:48:45] data/creaturescripts/scripts/souleater.luanKill
[26/02/2015 02:48:45] Description:
[26/02/2015 02:48:45] data/creaturescripts/scripts/souleater.lua:9: attempt to call global 'isSummon' (a nil value)
[26/02/2015 02:48:45] stack traceback:
[26/02/2015 02:48:45] data/creaturescripts/scripts/souleater.lua:9: in function <data/creaturescripts/scripts/souleater.lua:5>
This is the script:
Code:
local config = {
['souleater'] = {amount = 30, storage = 29000, startstorage = 60027, startvalue = 1}
}
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster or isSummon(target) then
return true
end
if getPlayerStorageValue(cid, monster.storage) >= -1 and (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount and getPlayerStorageValue(cid, monster.startstorage) >= monster.startvalue then
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Task message: '..(getPlayerStorageValue(cid, monster.storage)+1)..' of '..monster.amount..' '..getCreatureName(target)..'s killed.')
end
if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..(getPlayerStorageValue(cid, monster.storage)+1)..' '..getCreatureName(target)..'s and completed the '..getCreatureName(target)..'s mission.')
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
return true
end
And the error i'm getting is:
[26/02/2015 02:48:45] [Error - CreatureScript Interface]
[26/02/2015 02:48:45] data/creaturescripts/scripts/souleater.luanKill
[26/02/2015 02:48:45] Description:
[26/02/2015 02:48:45] data/creaturescripts/scripts/souleater.lua:9: attempt to call global 'isSummon' (a nil value)
[26/02/2015 02:48:45] stack traceback:
[26/02/2015 02:48:45] data/creaturescripts/scripts/souleater.lua:9: in function <data/creaturescripts/scripts/souleater.lua:5>
Last edited by a moderator: