Skylinx
Game Programmer
This is my firstitems.lua, It's giving me this error.
No matter what I change in the script, it always gives me this end expected near else error, it's pissing me off I put end there so many times, still :
Can someone please fix it for me?
Don't just say "It tells you where the problem is"
I don't what the hell to do, please help me T_T
No matter what I change in the script, it always gives me this end expected near else error, it's pissing me off I put end there so many times, still :
Code:
[09/01/2009 12:58:45] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/firstitems.lua
[09/01/2009 12:58:45] data/creaturescripts/scripts/firstitems.lua:17: 'end' expected (to close 'if' at line 8) near 'else'
PHP:
local firstItems =
{
2050,
2382
}
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems) do
doPlayerAddItem(cid, firstItems[i], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2651, 1)
else
doPlayerAddItem(cid, 2650, 1)
else
doPlayerAddItem(cid, 2648, 1)
else
doPlayerAddItem(cid, 2458, 1)
else
doPlayerAddItem(cid, 2643, 1)
else
doPlayerAddItem(cid, 2398, 1)
end
end
local bag = doPlayerAddItem(cid, 1987, 1)
doAddContainerItem(bag, 2666, 3)
doAddContainerItem(bag, 2190, 1)
doAddContainerItem(bag, 2389, 50)
doAddContainerItem(bag, 2182, 1)
doAddContainerItem(bag, 2160, 1)
doAddContainerItem(bag, 2367, 1)
doAddContainerItem(bag, 2428, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
Can someone please fix it for me?
Don't just say "It tells you where the problem is"
I don't what the hell to do, please help me T_T