Hiho, i have problem in this task skrypt.
In console i have this error
PHP:
local monsters = {
["demon"] = 35000,
["morgaroth"] = 35001,
}
function onKill(cid, target)
if(isPlayer(target) ~= TRUE) then
local name = getCreatureName(target)
local monster = monsters[string.lower(name)]
if(monster) then
local killedMonsters = getPlayerStorageValue(cid, monster)
if(killedMonsters == -1) then
killedMonsters = 1
end
if((name == "demon" and getPlayerStorageValue(cid, 66666) == 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " of 30 demons.")
setPlayerStorageValue(cid, monster, killedMonsters + 1)
if getPlayerStorageValue(cid, 35000)>30 then
setPlayerStorageValue(cid, 66666, 2)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough demons.")
end
elseif((name == "morgaroth" and getPlayerStorageValue(cid, 66666) == 4) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " of 15 Morgaroths.")
setPlayerStorageValue(cid, monster, killedMonsters + 1)
if getPlayerStorageValue(cid, 35001)>15 then
setPlayerStorageValue(cid, 66666, 5)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough Morgaroths.")
end
end
end
end
end
end
return TRUE
end
In console i have this error
PHP:
[04/10/2011 08:17:32] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/kill.lua:15: ')' expected near 'then'
[04/10/2011 08:17:32] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/kill.lua)
[04/10/2011 08:17:32] data/creaturescripts/scripts/kill.lua:15: ')' expected near 'then'