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

Summon spell

Alaa Adel

Basic Mapper
Joined
Mar 2, 2014
Messages
231
Reaction score
8
Hello :)
can someone tell me how to make a spell that summons 3 monsters without params and stuff... just when i say the spell it summons some number of monsters... that will be cool.
 
Tutorial how to tab scripts, but it also explains some of the basics like closing functions and if statements.
http://otland.net/threads/how-to-tab-lua-scripts.203763/

You have to close a function with end, you did this correct. The return true is also correct.
But the end above that doesn't close anything, so remove that
Code:
function onCastSpell(cid, var)
     doRemoveSummons(cid)
     end
     return true
end

So it should be like this.
Code:
function onCastSpell(cid, var)
     doRemoveSummons(cid)
     return true
end

I called the function I posted doRemoveSummon btw. So remove the s or add the s to the function.
 
[26/06/2014 02:10:48] Lua Script Error: [Spell Interface]
[26/06/2014 02:10:48] data/spells/scripts/support/remove summon.lua:eek:nCastSpell
[26/06/2014 02:10:48] data/spells/scripts/support/remove summon.lua:2: attempt to call global 'doRemoveSummon' (a nil value)
[26/06/2014 02:10:48] stack traceback:
[26/06/2014 02:10:48] [C]: in function 'doRemoveSummon'
[26/06/2014 02:10:48] data/spells/scripts/support/remove summon.lua:2: in function <data/spells/scripts/support/remove summon.lua:1>
 
You do have to add the function aswell.
Code:
local function doRemoveSummon(cid)
     for _, m in pairs(getCreatureSummons(cid)) do
         if getCreatureName(m) == "Dragon" then
             doRemoveCreature(m)
         end
     end
     return true
end

You can add it above function onCastSpell(cid, var).

Or you can also add it in global.lua, but then you have to remove local.
 
Back
Top