Count Dracula
New Member
- Joined
- Jul 30, 2013
- Messages
- 36
- Solutions
- 1
- Reaction score
- 1
Hi guys. I'm trying to make the summons of one boss transforms themselves after sometime into stronger creatures if not killed fast.
I thought in doing a custom spell for the summons, like this:
But I get this error on console:
How can I make this work?
Tfs version 1.2
I thought in doing a custom spell for the summons, like this:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
function onCastSpell(creature, var)
local spectators, spectator = Game.getSpectators(creature:getPosition(), false, false, 25, 25, 25, 25)
for i = 1, #spectators do
spectator = spectators[i]
if spectator:isMonster() and spectator:getName() == "master" then
creature:remove()
Game.createMonster("monster2", creature:getPosition())
return true
end
end
return combat:execute(creature, var)
end
But I get this error on console:
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/monster/monster.lua:onCastSpell
attempt to index a nil value
stack traceback:
[C]: in ?
[C]: in function 'createMonster'
data/spells/scripts/monster/monster.lua:10: in function <data/spells/scripts/monster/monster.lua:4>
How can I make this work?
Tfs version 1.2