JoccE
CopyLeft (ɔ)
Why does not this script work
No error message and no mana given to the player.
And btw why doesn´t the mana max update until you relog ?
No error message and no mana given to the player.
Lua:
local LifeStorage = 12001
local ManaStorage = 12002
local ManaAmount = 25
local HealthAmount = 25
local GiveMana = { -- Sorcerers and Druids
1,
2,
5,
6
}
local GiveHealth = { -- Paladins and Kights
3,
4,
7,
8
}
function onUse(cid, item, toPosition, itemEx, fromPosition)
if getPlayerVocation(cid) == isInArray(GiveMana) then
if getCreatureStorage(cid, ManaStorage) > 5 then
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + ManaAmount)
doRemoveItem(uid)
doCreatureSetStorage(cid, ManaStorage, 1)
end
end
if getPlayerVocation(cid) == isInArray(GiveHealth) then
if getCreatureStorage(cid, LifeStorage) > 5 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + HealthAmount)
doRemoveItem(uid)
doCreatureSetStorage(cid, LifeStorage, 1)
end
end
end
And btw why doesn´t the mana max update until you relog ?