MaR0
Banned User
- Joined
- Apr 16, 2018
- Messages
- 272
- Solutions
- 3
- Reaction score
- 29
Using tfs 0.3.7_svn. Sometimes when players make new characters the first items won't be taken dunno why? if there something wrong please post below the correct would be nice .
here is the script that i follow
in login.lua:-
here is the script that i follow
XML:
<event type="login" name="FirstItems" event="script" value="first items.lua"/>
Lua:
local SORCERER = 1
local DRUID = 2
local PALADIN = 3
local KNIGHT = 4
local items =
{
[SORCERER] =
{
{item=1988, count=1}, -- backpack
{item=7462, count=1}, --helmet
{item=2138, count=1}, -- an amulet (for test purpose)
{item=2121, count=1}, -- ring
{item=2190, count=1}, -- staff
{item=2361, count=1}, --frozen
{item=7460, count=1}, ---shield
{item=7463, count=1}, ---armor
{item=7464, count=1}, ---legs
{item=2643, count=1} ---boots
},
[DRUID] =
{
{item=1988, count=1}, -- backpack
{item=7462, count=1}, --helmet
{item=2138, count=1}, -- an amulet (for test purpose)
{item=2121, count=1}, -- ring
{item=2190, count=1}, -- staff
{item=2361, count=1}, --frozen
{item=7460, count=1}, ---shield
{item=7463, count=1}, ---armor
{item=7464, count=1}, ---legs
{item=2643, count=1} ---boots
},
[PALADIN] =
{
{item=1988, count=1}, -- backpack
{item=7462, count=1}, --helmet
{item=2138, count=1}, -- an amulet (for test purpose)
{item=2121, count=1}, -- ring
{item=2543, count=1}, -- bolt
{item=2455, count=1}, -- bolt
{item=2361, count=1}, --frozen
{item=7460, count=1}, ---shield
{item=7463, count=1}, ---armor
{item=2643, count=1}, ---boots
{item=7464, count=1} ---legs
},
[KNIGHT] =
{
{item=1988, count=1}, -- backpack
{item=7462, count=1}, --helmet
{item=2138, count=1}, -- an amulet (for test purpose)
{item=2121, count=1}, -- ring
{item=2383, count=1}, -- sword
{item=2361, count=1}, --frozen
{item=7460, count=1}, ---shield
{item=7463, count=1}, ---armor
{item=2643, count=1}, ---boots
{item=7464, count=1} ---legs
}
}
function onLogin(cid)
local vocation = items[getPlayerVocation(cid)]
if(not vocation) then
return true
end
local storage = getPlayerStorageValue(cid, 30001)
if(storage > 0) then
return true
end
for _, voc in ipairs(vocation) do
doPlayerAddItem(cid, voc.item, voc.count)
end
setPlayerStorageValue(cid, 30001, 1)
return true
end
Lua:
registerCreatureEvent(cid, "FirstItems")