Why is this not working? I don't exactly know how ends are supposed to work with elseif, so I'm changing it all around a lot, then I've finally given up. Can someone help me out here?
Here is the error:
Here is the script:
Here is the error:
[13:5:29.901] [Error - LuaInterface::loadFile] data/actions/scripts/quests/poisonclean.lua:12: 'end' expected (to close 'function' at line 1) near 'elseif'
[13:5:29.902] [Error - Event::checkScript] Cannot load script (data/actions/scripts/quests/poisonclean.lua)
[13:5:29.903] data/actions/scripts/quests/poisonclean.lua:12: 'end' expected (to close 'function' at line 1) near 'elseif'
Here is the script:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
store = getPlayerStorageValue(cid, 34903)
store2 = getPlayerStorageValue(cid, 34902)
if item.actionid == 34903 and store == -1 and store2 == -1 then
setPlayerStorageValue(34903, 1)
doCreatureSay(cid, "You are cleansed from poison, now you must do the lava side.", TALKTYPE_ORANGE_1)
else
doSendMagicEffect(fromPosition, 2)
doCreatureSay(cid, "You are already cleansed.", TALKTYPE_ORANGE_1)
end
elseif item.actionid == 34903 and store == -1 and store2 == 1 then
setPlayerStorageValue(34904, 1)
doCreatureSay(cid, "You have proven your ability to survive the most harsh conditions!", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "You may now move on.", TALKTYPE_ORANGE_1)
end
end
return true
end