Albanon
New Member
- Joined
- Mar 5, 2011
- Messages
- 93
- Reaction score
- 1
Below is the code I used to replace first items in my server (Mystic spirit 2.11pl2) Whenever I replace first items in
the creature scripts with this code, it prevents anyone from logging onto the server - the players just sit there "loading" the character. Can any one help? Why doesn't this work?
the creature scripts with this code, it prevents anyone from logging onto the server - the players just sit there "loading" the character. Can any one help? Why doesn't this work?
Code:
local firstItems =
{
1988,
2413,
2530,
2464,
2458,
2648
}
local secondItems =
{
1988,
2394,
2530,
2464,
2458,
2648
}
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 and getPlayerVocation(cid) == 9 then
for i = 1, table.maxn(firstItems) do
doPlayerAddItem(cid, firstItems[i], 1)
setPlayerStorageValue(cid, 30001, 1)
end
if getPlayerStorageValue(cid, 30001) == -1 and getPlayerVocation(cid) == 12 then
for i = 1, table.maxn(secondItems) do
doPlayerAddItem(cid, secondItems[i], 1)
setPlayerStorageValue(cid, 30001, 1)
end
end
return TRUE
end
end