Xagul
deathzot.net
- Joined
- Jun 30, 2008
- Messages
- 1,294
- Solutions
- 3
- Reaction score
- 1,037
Hello, I have been trying to make a summoning spell with limits to how many monsters you can summon. I have the number limit working but I would like it to check for a specific monster name for example:
So the player ends up with 1 rat and 1 cave rat.
The script I am currently using is:
As you can see its almost working, I just need it to check the names of summons instead of every summon the player has.
utevo res rat: summons a rat
utevo res rat: you can not have more than 1 rat at a time.
utevo res cave rat: summons cave rat
utevo res cave rat: you can not have more than 1 cave rat at a time.
So the player ends up with 1 rat and 1 cave rat.
The script I am currently using is:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, TRUE)
function onCastSpell(cid, var)
if(table.maxn(getCreatureSummons(cid)) >= 1) then
doPlayerSendCancel(cid, "You can't summon more than 1 rat at a time.")
else
creature = doCreateMonster("rat", getCreaturePosition(cid))
doConvinceCreature(cid, creature)
return doCombat(cid, combat, var)
end
end
As you can see its almost working, I just need it to check the names of summons instead of every summon the player has.