• 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 Error i cant resolve if anyone can help me please read this!!

Syndac123

New Member
Joined
Apr 22, 2014
Messages
14
Reaction score
0
[0] = 3065, -- female
[1] = 3058 -- male
function onPrepareDeath(cid, deathList)
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
doCreatureSetDropLoot(cid, false)
doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""
for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList) and "a " or "") .. getCreatureName(deathList)
end
doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
end
return true
end


this the script im using and this is the error i keep getting i cant fix it ;/


[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/forever aol.lua:1: unexpected symbol near '['
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/forever aol.lua)
data/creaturescripts/scripts/forever aol.lua:1: unexpected symbol near '['
 
Last edited:
Code:
local corpse_ids = {
    [0] = 3065, -- female
    [1] = 3058 -- male
}

function onPrepareDeath(cid, deathList)
    if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
        doCreatureSetDropLoot(cid, false)
        doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
        local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""
        for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
            killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList) and "a " or "") .. getCreatureName(deathList)
        end
        doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
    end
    return true
end
 
Use code tags when you post code it makes it easier for us to read the code and improves your chances of getting help.

You can't use a number as a variable, [0] is normally used as an index value of a table or array to assign a value to that element.
 
Don't just say same error, post the error, its impossible to have the same error when @Ancores just rewrote the script for you..
Post the error and the entire file so we can see what the problem is.


[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/forever aol.lua:1: unexpected symbol near '['
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/forever aol.lua)
data/creaturescripts/scripts/forever aol.lua:1: unexpected symbol near '['
 
See the 1 at the end of this line?
Code:
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/forever aol.lua:1:
That is the line of where the error begins
Code:
unexpected symbol near '['
This means you have a [ character on the 1st line of your script that is causing this error, so either post the entire script or stop wasting our time.
 
See the 1 at the end of this line?
Code:
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/forever aol.lua:1:
That is the line of where the error begins
Code:
unexpected symbol near '['
This means you have a [ character on the 1st line of your script that is causing this error, so either post the entire script or stop wasting our time.

sent the file in a.zip only way i could get it onto the site.
 

Attachments

  • creaturescripts.zip
    22.2 KB · Views: 2 · VirusTotal
The problem is you didn't replace the forever aol.lua in creaturescripts\scripts with the one in creaturescripts
Open the forever aol.lua in creaturescripts\scripts and delete what you in there and then copy @Ancores code and save it then restart the server
 
The problem is you didn't replace the forever aol.lua in creaturescripts\scripts with the one in creaturescripts
Open the forever aol.lua in creaturescripts\scripts and delete what you in there and then copy @Ancores code and save it then restart the server


o pfft wow now i just feel stupid 0,o..................
 
The problem is you didn't replace the forever aol.lua in creaturescripts\scripts with the one in creaturescripts
Open the forever aol.lua in creaturescripts\scripts and delete what you in there and then copy @Ancores code and save it then restart the server


but thank u very much for the help man alot;d
 
Back
Top