• 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!

[Problem script]

exanime

I´m learning Lua
Joined
Oct 24, 2011
Messages
40
Reaction score
3
Location
Bogota, Colombia
hello I would like to you can run this script because I want to do is the percentage of recharge mana and health when different levels , but I can not because I want element placed in the armor recharge blood every 2 seconds mana, but I manage not to run , I hope you can help me , this is my base. sorry for my bad English .

Code:
--percentage health--
local i = getCreatureMaxHealth(cid)
local a = 300
local b = 500
local c = math.random((i * (a/100)), (i * (b/100)))
--percentage Mana--
local j = getCreatureMaxMana(cid)
local d = 300
local e = 500
local f = math.random((j * (d/100)), (j * (e/100)))
--exhaust charge--
local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 15000)
setCombatCondition(combat, exhaust)
--function for boots--

function onEquip(cid, item, slot)
if item.itemid == 4928 then
doPlayerAddSpentMana(cid, c)
doCreatureAddHealth(cid, f)
getCreatureCondition(cid, exhaust)
doAddCondition(cid, exhaust)
    doAddCondition(cid, regeneration)
    doSendMagicEffect(CONST_ME_MAGIC_BLUE)
    else
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doPlayerSendCancel(cid, "quita las boot y pontelas de nuevo.")
    return false
end
end
 
Last edited:
just what I want is that when someone is a equipe boots will recharge a percentage of mana and health according to their level. I made this script but do not know whether or not this well done .

but it says a Boolean mistake about i.
 
eres español? explica mejor que quieres que haga y pon el error que te da en la consola

por cierto para que añada mana usa / btw to add mana use this
Code:
doPlayerAddMana(cid, c)
esta funcion es para otra cosa / this function is for another thing
Code:
doPlayerAddSpentMana(cid, c)

try to explain a little better what do you want the script to do and post the error you get on the console, put the variables after the function onEquip see what happens
 
Last edited:
jejeje Disculpa es que aqui la mayoria es de ingles, pues con el addspent es para que me recargue mas no le añada mana al jugador es decir lo que quiero es que al equiparlas recargue un porcentaje de mana y salud cada tanto tiempo pro le puse el exhaust, es decir si un lvl 100 se pone las boots le recargara un 20% que sera 20 de mana y salud pero a un lvl 600 le dara mas, pero no se por que me da error boleano en i si la declare bien
 
Back
Top