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

Lua Can't use item as rune :)

Wason

UnKnow Member
Joined
Jan 12, 2015
Messages
1,249
Reaction score
255
Location
EgypT
Wsup again ppls,
TFS 0.4 rev 3884
I tried to create some items as rune but i couldn't use them
I don't really know how to fix if someone got any idea maybe you can help ;)
Healing & Mana
aQORJACHQF2vFHMdUNtbCQ.png

Uh script
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 29)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
function onCastSpell(cid, var)
local allowedvocations = {4,8}

if not (isInArray(allowedvocations, getPlayerVocation(cid))) then
    doPlayerSendCancel(cid, "Only Knight are allowed to use.")
    return false
end
 if getPlayerStorageValue(cid, 41902) > 0 then
   doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
   doPlayerSendCancel(cid, "You cannot use healing spells/runes during the event.")
   return false
   end
    local formule = (getCreatureMaxHealth(cid) / 100) * math.random(35, 50)
    doCreatureAddHealth(cid, formule)
    return doCombat(cid, combat, var)
end
Another Question is that possible to create Perecent regeneration in Boots?
 
At the second question, yes of course.
Just make an onEquip or onThink function for the boots.
Use something similar to the 'formule' you have in the script you posted above.

You need to add to actions.xml and place this script in your actions folder.

And yes, that is possible.
I'd probably remove the storage value in this script.
It's not being used in this particular case and seems to be added for a special event that OP is likely not using in their server.
 
Well can you fix it for Allowe vocs ! Must be Ek only who can use this :)
How can i do that in items if that possible? :)
It already does that.
if not isKnight(cid)then

If your vocation is not a knight then
 
Back
Top