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

plzz help in this important

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
when i always get a manarune script i always get that error
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/manarune.lua)
server: TFS0.2.4 {8.50}
script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)    --Config    local reqml = 3         --Magic Level required to use it    local reqlvl = 15       --Character Level required to use it    local potExhaust = false    -- causes exhaust like potions (false creates seperate exhaust for mana rune)    local minMana = 10000     --Minimum amount of mana to be added    local maxMana = 10000         --Maximum amount of mana to be added    local ani = 1           --Animation to be sent to player when used (these can be found in your global.lua; search for CONST_ME_)    --If you don't want it to give health, set both to 0    local minHealth = 0       --Minimum amount of health to be added    local maxHealth = 0       --Maximum amount of health to be added    --If you're not using potion exhaust (potExhaust = false) edit the following the way you'd like    local storeValue = 50       --The storage value that will be used for exhaust if you have potexhaust to false    local exhaustTime = 0       --Exhaust in seconds    local infinite = true      --Will it cause rune to lose charges    local canUseInPz = true    --If true, mana rune may be used in PZ, otherwise, it will not work.    local player_say = "+10000"                            --What player says after successfully using the mana rune    local error_ml = "You don't have the required magic level to use that rune."    --What the cancel says when ml is too low    local error_lvl = "You don't have the required magic level to use that rune."   --What the cancel says when level is too low    local error_notPlayer = "You can only use this rune on players."        --What the cancel says when you try to use it on something not a player    local error_exhaust = "You are exhausted."                  --What the cancel says when you are exhausted    local error_pz = "You may not use this in Protected Zones." --What the cancel says when you are in PZ and canUseInPz is false    ------------------------------------------- DO NOT EDIT BELOW THIS LINE!! -------------------------------------------    ---------------------------START Check for Errors--------------------------------    --If doesn't allow use in PZ, send poof and cancel message    if canUseInPz == false  and getTilePzInfo(getPlayerPosition(cid)) == 1 then        doSendMagicEffect(fromPosition, CONST_ME_POFF)        doPlayerSendCancel(cid, error_pz)        return 0    end    --If not high enough level, send poof and cancel message    if getPlayerLevel(cid) < reqlvl then        doSendMagicEffect(fromPosition, CONST_ME_POFF)        doPlayerSendCancel(cid, error_lvl)        return 0    end    --If ml is too low, send poof and cancel message    if getPlayerMagLevel(cid) < reqml then        doSendMagicEffect(fromPosition, CONST_ME_POFF)        doPlayerSendCancel(cid, error_ml)        return 0    end    --If it's not a player, send poof and cancel message    if itemEx.uid < 1 then        doSendMagicEffect(fromPosition, CONST_ME_POFF)        doPlayerSendCancel(cid, error_notPlayer)        return 0    end    --Check if exhausted    if potExhaust == false then --If not using Potion Exhaust        if exhaust(cid, storeValue, exhaustTime) == 0 then            doSendMagicEffect(fromPosition, CONST_ME_POFF)            doPlayerSendCancel(cid, error_exhaust)            return 0        end    else --If you are using potion exhaust        if hasCondition(cid, CONDITION_EXHAUSTED) == 1 then            doPlayerSendCancel(cid, error_exhaust)            return 0        end    end    ---------------------------END Check for Errors--------------------------------    doSendMagicEffect(toPosition, ani)    doPlayerAddHealth(itemEx.uid, math.random(minHealth, maxHealth))    doPlayerAddMana(itemEx.uid, math.random(minMana, maxMana))    if infinite == false then        if item.type > 1 then            doChangeTypeItem(item.uid,item.type-1)        else            doRemoveItem(item.uid,1)        end    endend--Exhaust System created by Alreth--Edited by OsoSangrefunction exhaust(cid, storeValue, exhaustTime)    local newExhaust = os.time()    local oldExhaust = getPlayerStorageValue(cid, storeValue)    if (oldExhaust == nil or oldExhaust < 0) then        oldExhaust = 0    end    if (exhaustTime == nil or exhaustTime < 0) then        exhaustTime = 1    end    diffTime = os.difftime(newExhaust, oldExhaust)    if (diffTime >= exhaustTime) then        setPlayerStorageValue(cid, storeValue, newExhaust)        return 1    else        return 0    endend


i want to use advanced mana .no one post simple manarune plzz
 
Last edited:
Script for manarune "manarune.lua" in "spells\support or \healing"

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
doPlayerAddMana(cid, 500) 
return doCombat(cid, combat, var)
end

Add in spells.xml ->
PHP:
<rune name="manarune" id="RUNEITEMID HERE" charges="XX" maglv="X" exhaustion="XX" blocktype="solid" allowfaruse="1" aggressive="0" script="healing/manarune.lua"/>

Where: RUNEITEMID = the ItemID of the rune. Charges="XX" = Nº of charges of the rune. Maglv="x" = magic level needed, and Exhaustion="XX" = delay when using it. Use a normal delay like 700-800

Hope it works

Tadá
 
Back
Top