• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Need help fixing script - need pro scripters.

zoky12

New Member
Joined
Jul 4, 2008
Messages
60
Reaction score
0
Hello my mana system is fucked. When i die at lvl 140. i go back to 120s mana. Why? I THINK ITS THIS SCRIPT EFFECTING IT.

function onLogin(cid)
local townpos = {x = 1028, y = 1020, z = 7}
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 war server, here a list with commands:\n!online -> See online players\n!uptime -> See server uptime\n!highscore -> See server highscores (example: !highscore level)\n Multi-Client is not allowed in War server!!\n If use MC = auto logout\n//!"

--------------------------------------------------------------------------------------------------------------|
-------------|| CONFIG START ||--------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------------------|

config = {
Level = 120
}
sorc = {
Leben = 745,
Mana = 3395,
MagicLevel = 0,
Cap = 1590,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 10,
Shield = 10
}
druid = {
Leben = 745,
Mana = 3395,
MagicLevel = 15,
Cap = 1590,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 10,
Shield = 10
}
paladin = {
Leben = 1305,
Mana = 1715,
MagicLevel = 0,
Cap = 2710,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 10,
Shield = 20
}
knight = {
Leben = 1865,
Mana = 595,
MagicLevel = 0,
Cap = 3270,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 10,
Shield = 10
}

---------------------------------------------------------|
--------------- ITMES -----------------------------------|
---------------------------------------------------------|

sorcereritems = {
2196, -- Amulet of loss
2187, -- wand of inferno
8918, -- phoenix shield
2175, -- spellbook
8890, -- blue robe
7730, -- blue legs
9778, -- magician hat
2195, -- boots of haste
10521, -- backpack
6132 -- soft boots
}
druiditems = {
2196, -- Amulet of loss
8910, -- hailstorm rod
8918, -- phoenix shield
2175, -- spellbook
8866, -- blue robe
7730, -- blue legs
9778, -- magician hat
2195, -- boots of haste
10521, -- backpack
6132, -- soft boots
2269 -- wild grouth rune
}
paladinitems = {
2196, -- Amulet of loss
2520, -- demon shield
6529, -- spellbook
8888, -- crown armor
9777, -- crown legs
2493, -- crown helmet
2195, -- boots of haste
2164, -- might ring
10522, -- backpack
8472, -- great spirit portion
8850, --
8851, --
6132 -- soft boots
}
knightitems = {
2196, -- Amulet of loss
6433, -- mastermind shield
2400, -- magic sword
9776, -- golden armor
2470, -- golden legs
2471, -- golden helmet
2195, -- boots of haste
10518, -- backpack
6132 -- soft boots
}
---------------------------------------------------------------------------------------------------------------|
-------------|| CONFIG END ||----------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------------------|

-- 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
setCreatureMaxHealth(cid,voc.Leben)
setCreatureMaxMana(cid,voc.Mana)
db.executeQuery("UPDATE `players` SET `level` = "..config.Level.." WHERE `name` = '" .. getCreatureName(cid) .. "';")
db.executeQuery("UPDATE `players` SET `cap` = "..voc.Cap.." WHERE `name` = '" .. getCreatureName(cid) .. "';")
voc = nil
-- Outfit, Teleport, Text --
if getPlayerSex(cid) == 1 then
outfit = outfit_male
elseif getPlayerSex(cid) ~= 1 then
outfit = outfit_female
end
doCreatureAddHealth(cid,getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doCreatureAddMana(cid,getCreatureMaxMana(cid)-getCreatureMana(cid))
doTeleportThing(cid, townpos, true)
player_pos = getCreaturePosition(cid)
doSendMagicEffect(player_pos,10)
doPlayerPopupFYI(cid, text)
-----------
-- Items --
if getPlayerVocation(cid) == sorcVoc and getPlayerStorageValue(cid,5001) == -1 then
for i = 1, table.maxn(sorcereritems) do
doPlayerAddItem(cid, sorcereritems, 1)
setPlayerStorageValue(cid,5001,1)
end
elseif getPlayerVocation(cid) == druidVoc and getPlayerStorageValue(cid,5001) == -1 then
for i = 1, table.maxn(druiditems) do
doPlayerAddItem(cid, druiditems, 1)
setPlayerStorageValue(cid,5001,1)
end
elseif getPlayerVocation(cid) == palaVoc and getPlayerStorageValue(cid,5001) == -1 then
doPlayerAddItem(cid,7368,100) -- 100 assassin star
for i = 1, table.maxn(paladinitems) do
doPlayerAddItem(cid, paladinitems, 1)
setPlayerStorageValue(cid,5001,1)
end
elseif getPlayerVocation(cid) == knightVoc and getPlayerStorageValue(cid,5001) == -1 then
for i = 1, table.maxn(knightitems) do
doPlayerAddItem(cid, knightitems, 1)
setPlayerStorageValue(cid,5001,1)
end
end
-- All --
if getPlayerStorageValue(cid,5000) == -1 then
local bag1 = doPlayerAddItem(cid, 2000, 1)
doAddContainerItem(bag1, 8704, 1)
doAddContainerItem(bag1, 7618, 1)
doAddContainerItem(bag1, 7588, 1)
doAddContainerItem(bag1, 7591, 1)
doAddContainerItem(bag1, 8473, 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)
setPlayerStorageValue(cid,5000,1)
end
--------
end
return TRUE
end


Is this effecting why my mana is going back to the defualt mana that i started out with? I will suck ur cock if u get this script working.
 
Back
Top