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

Solved How to check storage from rune target

Pawcio6

Member
Joined
Sep 26, 2009
Messages
143
Solutions
4
Reaction score
15
Hi
I have a little problem becouse i dont know how to check storage from rune target in this line
Code:
if os.time() <= getPlayerStorageValue(RUNE TARGET?,53199) then
i try many things like var.pos getcreaturename(var) etc. but every time i get
(luaGetCreatureStorage) Creature not found
some1 help?
sorry for my bad english and thank you :D
 
local target = variantToNumber(var)
if not isCreature(target) then
-- no target (should not happen if it can only be targetted on creatures like sd)
else
-- target variable is the target of rune
end
 
it changed only i dont get an error in console but still rune dont see creature and do nothing. its mine rune script
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 134)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -0.9, 0, -0.9, 0)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
local target = variantToNumber(var)
if not isCreature(target) then  
        return true
            end
    if os.time() <= getPlayerStorageValue(cid,53193) then
            doPlayerSendCancel(cid,"You can use this rune only once in 10 seconds.")
            doSendMagicEffect(getPlayerPosition(cid),2)
            return true
            end
    if os.time() <= getPlayerStorageValue(target,53199) then
            doPlayerSendCancel(cid,"You can not paralyze same player so fast!")
            doSendMagicEffect(getPlayerPosition(cid),2)
            return true
            end
            if getPlayerMana(cid) >= 11000 then
setPlayerStorageValue(cid, 53193,(os.time() + 10))
doCombat(cid, combat, var)
doPlayerAddMana(cid, -11000, false)
            doPlayerAddSpentMana(cid,11000)
            else
            doPlayerSendCancel(cid,"You do not have enough mana.")
                        doSendMagicEffect(getPlayerPosition(cid),2)
            end
return true
end
 
Last edited:
Is the rune only usable on creatures like sd or you can use it anywhere like gfb?
 
spells.xml part
Code:
<rune name="Paralyze" id="2273" allowfaruse="1" lvl="145" mana="0" maglv="15" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="dende/paralyze rune.lua"/>
and server 0.3.6 tfs
 
Use:
Code:
function onTargetCreature(cid, target)
   if (getPlayerStorageValue(target, storage) == 1) then
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
   end
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
 
i add this
Code:
function onTargetCreature(cid, target)
    if os.time() <= getPlayerStorageValue(target,53199) then
            doPlayerSendCancel(cid,"You can not paralyze same player so fast!")
            doSendMagicEffect(getPlayerPosition(cid),2)
            return false
            end
            return true
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
i get message and effect but still it make combat
 
Back
Top