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

TFS 1.X+ Summon in other players - TFS 1.3

GOD Half

Member
Joined
May 9, 2010
Messages
179
Reaction score
15
Hi guys, I need fixing this problem. I did this script to summon some monsters, but he always summons the other players too, can anyone help me, please? Thank's
FDq5oiSmRpaWIRByhSqa3A.jpeg

Lua:
local configId = {
    [1] = {"Corym Charlatan"}
}

function onCastSpell(creature, variant)
for _, player in ipairs(Game.getPlayers()) do
local namePlayer = player:getName()
local positionPlayer = player:getPosition()
local summonPlayer = player:getSummons()
local target = player:getTarget()
local master = getCreatureMaster(namePlayer)
    if master then
        for _, i in pairs(configId) do
            if type(i) == 'table' then
                NamePet = i[1]
                if (#summonPlayer > 0) then
                    for _, SummonID in ipairs(summonPlayer) do
                        summonName = getCreatureName(SummonID)
                    end
                else
                    summonName = "no summon summoned"
                end
                if (summonName ~= NamePet) then
                    if target then
                        if isPlayer(target) or isMonster(target) then
                            local positionTarget = getCreaturePosition(target)
                            for r = 1, math.random(2,5) do
                                local PetNameSummon = doForceSummonCreature(NamePet, positionTarget)
                                doConvinceCreature(player, PetNameSummon)
                            end
                        end
                    else
                        for r = 1, math.random(2,5) do
                            local PetNameSummon = doForceSummonCreature(NamePet, positionPlayer)
                            doConvinceCreature(player, PetNameSummon)
                        end
                    end
                else
                    doPlayerSendCancel(player, "You already have summoned "..NamePet..".")
                return false
                end
            end
        end
    end
end
return true
end
 
Back
Top