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

What i need to do?

Rashha

Member
Joined
Aug 5, 2019
Messages
26
Reaction score
9
Hi, i have question
i need make spell that work when we got summon with name, not with value.
ex: if we have summon ghost, we can use spell, and when we have other summon e.g Fireman we cant cast this spell because its other summon.
i dont know how to do this, because other player will have too summon with name Ghost, and when they will see on screen this summon they can use spell?

i need change this:

Code:
local summons = getCreatureSummons(cid)
if #summons <= 0 then
return doPlayerSendCancel(cid,"You dont have summon Ghost!")
end
 
Solution
i want that player can use heal spell if have summoned "ghost"
if not then cant use this spell ;p
like this.. I guess?
Lua:
local summons = getCreatureSummons(cid)
if #summons > 0 then
    for i = 1, #summons do
        if getCreatureName(summons[i]):lower() == "ghost" then
            -- can use spell
            return true
        end
    end
end
return doPlayerSendCancel(cid,"You dont have summon Ghost!") and false
Can you try to explain it better / differently?
I'm not sure exactly what you want to happen in your spell.
 
i want that player can use heal spell if have summoned "ghost"
if not then cant use this spell ;p
like this.. I guess?
Lua:
local summons = getCreatureSummons(cid)
if #summons > 0 then
    for i = 1, #summons do
        if getCreatureName(summons[i]):lower() == "ghost" then
            -- can use spell
            return true
        end
    end
end
return doPlayerSendCancel(cid,"You dont have summon Ghost!") and false
 
Solution
thanks its work, i have other question, can i do exiva work only with storage XXXX but without source edit? i mean can i make this spell like .lua?
 
thanks its work, i have other question, can i do exiva work only with storage XXXX but without source edit? i mean can i make this spell like .lua?
 
fck now dont work @Xikini i cant repair this can u look?

Code:
function onCastSpell(cid, var)
if (getPlayerStorageValue(cid, 15125) - os.time()) > 0 then 
return doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) and doPlayerSendCancel(cid, "You are exhausted in regeneration for: "..(getPlayerStorageValue(cid, 15125) - os.time() ).." seconds.") and false
end
 local bonus = 650
local summons = getCreatureSummons(cid)
if #summons > 0 then
    for i = 1, #summons do
        if getCreatureName(summons[i]):lower() == "ghost" then
            -- can use spell
            return true
        end
    end
end
return doPlayerSendCancel(cid,"You dont have summon Ghost!") and false

setPlayerStorageValue(cid, 15125, (os.time() + 2))
    player.add(cid)
    min = player:getLevel() * 2.1 + player:getNinjutsu() * 2 + bonus
    max = min * 1.1
    player:health(math.random(min, max))
    player:sendEffect(12)
return true
end

and problem:
 

Attachments

  • e345312e4abb67b55e1daab262f3e6c1.png
    e345312e4abb67b55e1daab262f3e6c1.png
    4.9 KB · Views: 4 · VirusTotal
Last edited:
Back
Top