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

~Pet system~NPC~

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
Hello and good day.
I want to have Pets in my server,im using 3.6

Here we go:
-I do not want to player need to summon a Monster for a Pet!I want to monster be in the items,example item id: 5468 when player Open that item i want to player get a monster pet,example Demon?
-I want to player can upload his Pets!example:Attack,Speed,invisibility,Look's,Name,Protection from Fire,Ice...,Mana,Helath,and to player can make his pet to say anything!!!
 
hey i have this script u can summon pet and call it back

function onUse(cid, item, fromPosition, itemEx, toPosition)
local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')

local config = {
storageExhaust = 55668,
exhaustTime = 10,
effect = CONST_ME_HITBYFIRE
}

if exhaustion.check(cid, config.storageExhaust) ~= false then
return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, config.storageExhaust)..' seconds to use this item again.')
end

if not isCreature(itemEx.uid) then
if string.find(desc:lower(), 'catched monster:') ~= nil then
local x, y = string.find(desc, ': %a+.')
local a, b = string.find(desc, ': %a+ %a+.')

if getTileInfo(getThingPos(cid)).protection then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can\'t summon monster in protection zone.')
end

if a ~= nil then
if #getCreatureSummons(cid) == 0 then
local x = doSummonMonster(cid, string.sub(desc, a + 2, b - 1))
doCreatureSay(cid, 'Go '..string.sub(desc, a + 2, b - 1)..'!', TALKTYPE_MONSTER_YELL)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), config.effect)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned monster.')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have back your pet.')
doRemoveCreature(getCreatureSummons(cid)[1])
doCreatureSay(cid, 'Back my pet!', TALKTYPE_MONSTER_YELL)
end
elseif x ~= nil then
if #getCreatureSummons(cid) == 0 then
local x = doSummonMonster(cid, string.sub(desc, x + 2, y - 1))
doCreatureSay(cid, 'Go '..string.sub(desc, x + 2, y - 1)..'!', TALKTYPE_MONSTER_YELL)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), config.effect)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned monster.')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have back your pet.')
doRemoveCreature(getCreatureSummons(cid)[1])
doCreatureSay(cid, 'Back my pet!', TALKTYPE_MONSTER_YELL)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknow monster.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into vial.')
end
elseif itemEx.uid == cid then
if #getCreatureSummons(cid) > 0 then
if string.find(desc:lower(), 'catched monster:') ~= nil then
local x, y = string.find(desc, ': %a+.')
if x ~= nil then
for k, v in pairs(getCreatureSummons(cid)) do
if getCreatureName(v):lower() == string.sub(desc, x + 2, y - 1) then
doRemoveCreature(v)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your summon backed to vial.')
break
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknow monster.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into vial.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t summon anything.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can summon catched monster if you will use it on tile or, on self if you want to that summon back to vial.')
end

exhaustion.set(cid, config.storageExhaust, config.exhaustTime)
return true
end
 
Back
Top