Hello, I want people to start with equipment, but that they get it only once ofcourse. For some reason the sample chars won't give over the equipment..
So I want to use a firstitem script on creaturescripts. But it's not working, I'm not getting any items when I'm creating a new character.
This is the script I'm using, any suggestions?
Thanks in advance,
UpAndDown!
So I want to use a firstitem script on creaturescripts. But it's not working, I'm not getting any items when I'm creating a new character.
Code:
local firstItems =
{
2120,
5710,
2000
}
local Eq = {
knight = {8602, 2439, 8601, 2465, 2478, 2643, 2481, 2509},
sorcerer = {2643, 2468, 8819, 8820, 2190, 2175},
druid = {2643, 2468, 8819, 8820, 2182, 2175},
paladin = {2643, 2465, 2478, 2389, 2511, 2480}
}
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
if isKnight(cid) == TRUE then
for i = 1, table.maxn(Eq.knight) do
doPlayerAddItem(cid, Eq.knight[i], 1)
end
if getPlayerStorageValue(cid, 30001) == -1 then
elseif isSorcerer(cid) == TRUE then
for i = 1, table.maxn(Eq.sorcerer) do
doPlayerAddItem(cid, Eq.sorcerer[i], 1)
end
if getPlayerStorageValue(cid, 30001) == -1 then
elseif isDruid(cid) == TRUE then
for i = 1, table.maxn(Eq.druid) do
doPlayerAddItem(cid, Eq.druid[i], 1)
end
if getPlayerStorageValue(cid, 30001) == -1 then
elseif isPaladin(cid) == TRUE then
for i = 1, table.maxn(Eq.paladin) do
doPlayerAddItem(cid, Eq.paladin[i], 1)
end
end
end
This is the script I'm using, any suggestions?
Thanks in advance,
UpAndDown!