Triggah
TrigCore
- Joined
- Aug 1, 2007
- Messages
- 436
- Reaction score
- 2
My items are duplicating, when player logs out or dies the items double in his bp, i want it so everytime the player dies, he logs with same items he started with
whats wrong with this?
Lua:
--[[ Script by Maxi (Shawak)
Login for Maxis-War
v2.0
]]--
function onLogin(cid)
local serverName = getConfigValue('serverName')
local start_pos = getConfigValue('start_pos')
local points = getConfigValue('points')
local start_pos_player = start_pos[math.random(1, #start_pos)]
local text = "Welcome to TrigCore, here a list with all commands:\n!online -> See online players\n!uptime -> See server uptime\n!serverinfo -> See server info\n!points -> See your points (kill someone to get them)\n!highscore -> See the highscore\n//TrigCore Team -> If you just created account and skills didnt take effect, relog and you should be good to go!"
---------------------------------------------------------------------------------------------------------------|
-------------|| CONFIG START ||--------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------------------|
config = {
Level = 120
}
sorc = {
Leben = 745,
Mana = 3395,
MagicLevel = 82,
Cap = 1590,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 50,
Shield = 24
}
druid = {
Leben = 745,
Mana = 3395,
MagicLevel = 82,
Cap = 1590,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 50,
Dist = 10,
Shield = 24
}
paladin = {
Leben = 1305,
Mana = 1715,
MagicLevel = 24,
Cap = 2710,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 134,
Shield = 70
}
knight = {
Leben = 1865,
Mana = 595,
MagicLevel = 11,
Cap = 3270,
Fist = 140,
Club = 126,
Sword = 126,
Axe = 126,
Dist = 10,
Shield = 94
}
---------------------------------------------------------|
--------------- ITMES -----------------------------------|
---------------------------------------------------------|
sorcereritems = {
2187, -- wand of inferno
2539, -- phoenix shield
2175, -- spellbook
2656, -- blue robe
7730, -- blue legs
2662, -- magician hat
2195, -- boots of haste
2167, -- energy ring
1988 -- backpack
}
druiditems = {
2183, -- hailstorm rod
2539, -- phoenix shield
2175, -- spellbook
2656, -- blue robe
7730, -- blue legs
2662, -- magician hat
2195, -- boots of haste
2167, -- energy ring
1988 -- backpack
}
paladinitems = {
2520, -- demon shield
2175, -- spellbook
2487, -- crown armor
2488, -- crown legs
2491, -- crown helmet
2195, -- boots of haste
2164, -- might ring
1988, -- backpack
8472 -- great spirit portion
}
knightitems = {
2514, -- mastermind shield
2400, -- magic sword
2175, -- spellbook
2466, -- golden armor
2470, -- golden legs
2471, -- golden helmet
2195, -- boots of haste
2210, -- sword ring
1988 -- backpack
}
---------------------------------------------------------------------------------------------------------------|
-------------|| CONFIG END ||----------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------------------|
local outfit_male = {
lookType = math.random(128,134),
lookHead = math.random(0,132),
lookBody = math.random(0,132),
lookLegs = math.random(0,132),
lookFeet = math.random(0,132),
lookTypeEx = 0,
lookAddons = 3
}
local outfit_female = {
lookType = math.random(136,142),
lookHead = math.random(0,132),
lookBody = math.random(0,132),
lookLegs = math.random(0,132),
lookFeet = math.random(0,132),
lookTypeEx = 0,
lookAddons = 3
}
-- vocation -----
sorcVoc = 1
druidVoc = 2
palaVoc = 3
knightVoc = 4
-----------------
if getCreatureName(cid) ~= "Account Manager" and getPlayerGroupId(cid) == 1 then
if getPlayerVocation(cid) == sorcVoc then
voc = sorc
elseif getPlayerVocation(cid) == druidVoc then
voc = druid
elseif getPlayerVocation(cid) == palaVoc then
voc = paladin
elseif getPlayerVocation(cid) == knightVoc then
voc = knight
end
if getPlayerStorageValue(cid,points) == -1 then
setPlayerStorageValue(cid,points,0)
end
-----------
-- Items --
if getPlayerVocation(cid) == sorcVoc then
for i = 1, table.maxn(sorcereritems) do
doPlayerAddItem(cid, sorcereritems[i], 1)
end
elseif getPlayerVocation(cid) == druidVoc then
for i = 1, table.maxn(druiditems) do
doPlayerAddItem(cid, druiditems[i], 1)
end
elseif getPlayerVocation(cid) == palaVoc then
doPlayerAddItem(cid,7368,100) -- 100 assassin star
for i = 1, table.maxn(paladinitems) do
doPlayerAddItem(cid, paladinitems[i], 1)
end
elseif getPlayerVocation(cid) == knightVoc then
for i = 1, table.maxn(knightitems) do
doPlayerAddItem(cid, knightitems[i], 1)
end
end
-- All --
local bag1 = doPlayerAddItem(cid, 2000, 1)
doAddContainerItem(bag1, 8704, 1)
doAddContainerItem(bag1, 7618, 1)
doAddContainerItem(bag1, 7588, 1)
doAddContainerItem(bag1, 7591, 1)
doAddContainerItem(bag1, 2273, 1)
local bag2 = doPlayerAddItem(cid, 2001, 1)
doAddContainerItem(bag2, 7620, 1)
doAddContainerItem(bag2, 7589, 1)
doAddContainerItem(bag2, 7590, 1)
local bag3 = doPlayerAddItem(cid, 1998, 1)
doAddContainerItem(bag3, 2293, 1)
doAddContainerItem(bag3, 2278, 1)
doAddContainerItem(bag3, 2262, 1)
doAddContainerItem(bag3, 2305, 1)
doAddContainerItem(bag3, 2261, 1)
doAddContainerItem(bag3, 2303, 1)
doAddContainerItem(bag3, 2279, 1)
doAddContainerItem(bag3, 2313, 1)
doAddContainerItem(bag3, 2268, 1)
doAddContainerItem(bag3, 2262, 1)
--------
end
return TRUE
end
whats wrong with this?