Chaos Origin
New Member
- Joined
- Oct 31, 2017
- Messages
- 6
- Reaction score
- 2
Hello everyone, I wanted to create a spell that summons a specified creature so that different vocasions have their own creatures. I'm totally new to this, but after some struggle I came up with this:
And it works, my only problem is that it allows player to have unlimited summons and to be honest I have no clue how to put some limit here. Can anyone give some tips on how to do it?
Lua:
function onCastSpell(cid, var)
local config =
{
playerpos = getPlayerPosition(cid),
creature = "creature name",
effects = {CONST_ME_MAGIC_RED, CONST_ME_POFF}
}
local summon = doSummonCreature(cid, config.creature, config.playerpos)
if (summon == RETURNVALUE_NOERROR) then
doConvinceCreature(cid, summon)
doSendMagicEffect(config.playerpos, config.effects[1])
return true
else
doSendMagicEffect(config.playerpos, config.effects[2])
doPlayerSendDefaultCancel(cid, config.playerpos)
return false
end
end