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

Solved [TFS 1.2] Creature summon not setting master

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
 
Back
Top