• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Requesting item that summons monster to kill

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
tfs 1.2-1.3 (pretty sure 1.3, but tfs 1.2 seems to work too)

Hello guys, im begging for a script that summons a monster to kill, so when you summon the monster, it starts attacking you like a real monster

also if possible, i need another item that summons a monster but as utevo res, to attack for you, and that it works despite your vocation



this would be very appreciated <3
 
Well, if you know how to convert scripts.. this is a very easy request.
Honestly, you can probably use it as-is.
Sure, you can add all sorts of effects and checks to make the script more complicated but this is basically what your asking for, no?

0.3.7
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   doCreateMonster("Rat", fromPosition)
   doRemoveItem(item.uid, 1)
   return true
end
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if getCreatureSummons(cid) < 2 then
       doSummonMonster(cid, "Rat")
       doRemoveItem(item.uid, 1)
   end
   return true
end
 
Last edited by a moderator:
Hope this work for you, regards! :D
LUA:
-- This for wild monster
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    Game.createMonster("demon", player:getPosition())
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have summoned a wild monster.")
item:remove(1)
    return true
end

-- This for summon monster

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local monster = Game.createMonster("demon", player:getPosition())
    if not monster then
        return player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
    player:addSummon(monster) --edited ty @Static_ 
    item:remove(1)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have summoned a monster.")
    return true
end
 
Last edited:
in 1.3 you have to do it differently by using the creature:addSummon(monster) instead of monster:setMaster(creature)
change monster:setMaster(player) to player:addSummon(monster)
 
Hope this work for you, regards! :D
LUA:
-- This for wild monster
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    Game.createMonster("demon", player:getPosition())
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have summoned a wild monster.")
item:remove(1)
    return true
end

-- This for summon monster

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local monster = Game.createMonster("demon", player:getPosition())
    if not monster then
        return player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
    player:addSummon(monster) --edited ty @Static_
    item:remove(1)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have summoned a monster.")
    return true
end

hey thanks! im testing the summon one but when it summons it doesn't attack what i want nor follows me :( (this was with GM)

now tested it with normal character and the demon attacks me xD

and for the first script works great, it summons the monster, but could you add plzzz something for pz zones? like you can't use this in pz? because i used it in the temple and the item was gone and no monster


thank you very much
 
Last edited:
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerPos = player:getPosition()
    if Tile(playerPos):hasFlag(TILESTATE_PROTECTIONZONE) then
        playerPos:sendMagicEffect(CONST_ME_POFF)
        return true
    end

    Game.createMonster("demon", playerPos)
    item:remove(1)
    return true
end
 
Back
Top