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

[Help] Summon script Advanced

lordkronox

Scripter & Helper
Joined
Sep 9, 2010
Messages
52
Reaction score
1
i need help with this script:
PHP:
function onUse(cid, item, frompos, item2, topos)
    local summon = doSummonCreature("Demon",topos)
	local summons = getCreatureSummons(cid) 
   
    if summons == 0 then   
        doConvinceCreature(cid, summon)
	    doCreatureSay(cid, "Demon, i need your help!!", TALKTYPE_SAY)
		doSendMagicEffect(topos, 46)
	elseif summons == 1
	    doPlayerSendCancel(cid, "Max summons is one.")
    end
end

Help.. My TFS is 0.3.4...

i get error in function getPlayerSummons ..
i have created this script to summon one monster only, if the summon die the player summon he again..

HELP
 
Lua:
function onUse(cid, item, frompos, item2, topos)
    local summon = doSummonCreature("Demon",topos)
    local summons = getCreatureSummons(cid) 
   
if(table.maxn(summons) < 1) then 
        doSummonMonster(cid, summon)
        doCreatureSay(cid, "Demon, i need your help!!", TALKTYPE_SAY)
        doSendMagicEffect(topos, 46)
    else
        doPlayerSendCancel(cid, "Max summons is one.")
    end
end
 
Last edited:
Fail...
i have summoned one demon.. Ok
i have summoned +1 demon and i not receive the message of maxsummons.
i try summon 3 demons , and the 3 demons are summoned without errors.
 
No. Should be doSummonMonster(cid, summon). You use convince when u want take over monsters.


Sry i give You bad code :D Now is good (You can summon only 1 demon)

Lua:
function onUse(cid, item, frompos, item2, topos)
    local summon = "demon"
    local summons = getCreatureSummons(cid) 
 
    if(table.maxn(summons) < 1) then 
        doSummonMonster(cid, summon)
        doCreatureSay(cid, "Demon, i need your help!!", TALKTYPE_SAY)
        doSendMagicEffect(topos, 46)
    else
        doPlayerSendCancel(cid, "Max summons is one.")
    end
    return true
end
 
Last edited:
Back
Top