Não testei, se der certo de um feedback!
function onCastSpell(creature, var)
local from, to = {x = 962, y = 885, z = 7}, {x = 973, y = 892, z = 7}
local from2, to2 = {x = 979, y = 901, z = 7}, {x = 991, y = 905, z = 7}
local player = Player(creature)
local playerpos = player:getPosition()
local playerName = player:getName() -- Obtenha o nome do jogador
local cloth = player:getOutfit()
local health = player:getHealth()
local maxhealth = player:getMaxHealth()
local MaximoSummon = 3
local summons = player:getSummons()
local distance = getDistanceBetween(playerpos, from)
local distance2 = getDistanceBetween(playerpos, from2)
if (distance >= 0 and distance <= 10) or (distance2 >= 0 and distance2 <= 10) then
player:sendCancelMessage("Nie możesz użyć tego jutsu tutaj!")
return false
end
if table.maxn(summons) < MaximoSummon then
local remainingClones = MaximoSummon - table.maxn(summons)
for i = 1, remainingClones do
local clone = Game.createMonster("clone", playerpos)
doConvinceCreature(creature, clone:getId())
clone:setMaxHealth(maxhealth)
clone:addHealth(health)
clone:setOutfit(cloth, -1)
clone:setName(playerName) -- Defina o nome do clone como o nome do jogador
end
end
return true
end