• 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 FIX spells [function] no logout HELP

tomoro1x

New Member
Joined
Dec 29, 2014
Messages
10
Reaction score
0
Hello, is anyone able to help me? give or add a function that could not use a spell to NO LOGOUT (google translate)

Code:
local function f(c)

    if isMonster(c) then
        doRemoveCreature(c)
    end
end
local  summonName = "SUMMON"
local  summonTime = 100

function onCastSpell(cid, var)


    local p = getThingPos(cid)
    local summons = getCreatureSummons(cid)

    if getTileInfo(p).protection then
        doCreatureSay(cid, 'You cannot summon in PZ!', TALKTYPE_ORANGE_1, false, cid, p)
        doSendMagicEffect(p, CONST_ME_POFF)
    elseif #summons  > 0 then
    local sumonCheck = false
        for _, pid in ipairs(summons) do
            if getCreatureName(pid) == summonName then
                sumonCheck = true
            end
        end
        if sumonCheck then
            doPlayerSendCancel(cid, 'You can\'t summon more than one.')
            doSendMagicEffect(p, CONST_ME_POFF)
        else
            local r = doSummonMonster(cid, summonName)
            if r == 1 then
                doSendMagicEffect(getPlayerPosition(cid), 223)
                doPlayerSendCancel(cid, summonName .." is ready to help you.")
                addEvent(f, summonTime*1000, getCreatureSummons(cid)[1])
                return true
            else
                doPlayerSendDefaultCancel(cid, r)
            end
        end



    else
        local r = doSummonMonster(cid, summonName)
        if r == 1 then
            doSendMagicEffect(getPlayerPosition(cid), 223)
            doPlayerSendCancel(cid, summonName .." is ready to help you.")
            addEvent(f, summonTime*1000, getCreatureSummons(cid)[1])
            return true
        else
            doPlayerSendDefaultCancel(cid, r)
        end
    end
end
 
Hello, is anyone able to help me? give or add a function that could not use a spell to NO LOGOUT (google translate)

Code:
local function f(c)

    if isMonster(c) then
        doRemoveCreature(c)
    end
end
local  summonName = "SUMMON"
local  summonTime = 100

function onCastSpell(cid, var)


    local p = getThingPos(cid)
    local summons = getCreatureSummons(cid)

    if getTileInfo(p).protection then
        doCreatureSay(cid, 'You cannot summon in PZ!', TALKTYPE_ORANGE_1, false, cid, p)
        doSendMagicEffect(p, CONST_ME_POFF)
    elseif #summons  > 0 then
    local sumonCheck = false
        for _, pid in ipairs(summons) do
            if getCreatureName(pid) == summonName then
                sumonCheck = true
            end
        end
        if sumonCheck then
            doPlayerSendCancel(cid, 'You can\'t summon more than one.')
            doSendMagicEffect(p, CONST_ME_POFF)
        else
            local r = doSummonMonster(cid, summonName)
            if r == 1 then
                doSendMagicEffect(getPlayerPosition(cid), 223)
                doPlayerSendCancel(cid, summonName .." is ready to help you.")
                addEvent(f, summonTime*1000, getCreatureSummons(cid)[1])
                return true
            else
                doPlayerSendDefaultCancel(cid, r)
            end
        end



    else
        local r = doSummonMonster(cid, summonName)
        if r == 1 then
            doSendMagicEffect(getPlayerPosition(cid), 223)
            doPlayerSendCancel(cid, summonName .." is ready to help you.")
            addEvent(f, summonTime*1000, getCreatureSummons(cid)[1])
            return true
        else
            doPlayerSendDefaultCancel(cid, r)
        end
    end
end
I don't quite understand your question.
 
Back
Top