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

Summon Creature tfs v1.2 (SOLVED)

Hahstudios

New Member
Joined
Mar 11, 2010
Messages
49
Solutions
3
Reaction score
1
im wanting a script thats specific for a vocation (summoner).

im needing a script to summon specific creatures and counts them so you can only have 3 of X monster.

and you can not be dmged by its spells if possible thanks in advanced :)
 
Solution
Code:
local config = {
    maxSummons = X,
    summonName = "creaturename"
}

function onCastSpell(creature, var)
    local player = creature:getPlayer()
    if player == nil then
        return false
    end

    local playerPosition = player:getPosition()
    if #player:getSummons() > config.maxSummons then -- Player has already to many summons
        playerPosition:sendMagicEffect(CONST_ME_POFF)
        return false
    end

    local monster = Game.createMonster(config.summonName, playerPosition, false, false)
    if not monster then -- If there is no room the summon the monster, lets force it!
        Game.createMonster(config.summonName, playerPosition, false, true)
    end

    monster:setMaster(player)
    return true
end
Code:
local config = {
    maxSummons = X,
    summonName = "creaturename"
}

function onCastSpell(creature, var)
    local player = creature:getPlayer()
    if player == nil then
        return false
    end

    local playerPosition = player:getPosition()
    if #player:getSummons() > config.maxSummons then -- Player has already to many summons
        playerPosition:sendMagicEffect(CONST_ME_POFF)
        return false
    end

    local monster = Game.createMonster(config.summonName, playerPosition, false, false)
    if not monster then -- If there is no room the summon the monster, lets force it!
        Game.createMonster(config.summonName, playerPosition, false, true)
    end

    monster:setMaster(player)
    return true
end
 
Solution
Back
Top