Caduceus
Unknown Member
- Joined
- May 10, 2010
- Messages
- 321
- Solutions
- 2
- Reaction score
- 24
The issue I am having is when the player summons the "templar" it is not setting the player as master, unless the player has access.
Code:
function onCastSpell(player, variant)
local playerPos = player:getPosition()
if #player:getSummons() >= 1 then
player:sendCancelMessage("You cannot summon more creatures.")
playerPos:sendMagicEffect(CONST_ME_POFF)
return false
end
local monster = Game.createMonster("templar", playerPos)
-- Place the monster
monster:setMaster(player)
playerPos:sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end