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

Requesting Pet Script

Panduh

Panduh Approves.
Joined
Jun 9, 2013
Messages
111
Reaction score
1
Location
Panda Land ofc
Hello and id like to get a script so when you use Lizard_Essence.gif (ID: 12597) and you can make the monster Lizard_Snakecharmer.gif (Lizard Snakecharmer)
 
In actions make new file lizardsumm.lua and paste this:
PHP:
function onUse(cid, item, frompos, item2, topos) 
local pos = getCreaturePosition(cid)
if getPlayerItemCount(cid,12597) >= 1 then
	doPlayerRemoveItem(cid, 12597, 1)
	doCreateMonster("Lizard Snakecharmer", pos)
	else
	doPlayerSendCancel(cid, "Sorry, not possible.")
end
return true
end

And add to actions.xml this line:
PHP:
	<action itemid="12597" event="script" value="lizardsumm.lua"/>

Should work.
 
@UP
That script will create a wild monster and its badly made, you dont need to define the itemid when you already doing it in the xml and you dont need to put else if, they dont have the item, they wont be able to create so why put else?

----My Script----

I hope this will fulfill your needs!

First go to actions/actions.xml and paste the line below:
XML:
<action itemid="12597" event="script" value="pet_summon.lua"/>

Now go to actions/scripts and create new lua and name it "pet_summon.lua" and paste the code below:
Lua:
local config = {
	monster_name = "Lizard Snakecharmer",
	max_summons = 1
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getTileInfo(getThingPos(cid)).protection) then   
		return (doPlayerSendCancel(cid, "You can't use this item in protection zone.") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF))
	end
	if (#getCreatureSummons(cid) >= config.max_summons) then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	if (config.max_summons <= 1) then
		doPlayerSendCancel(cid, "You can only summon max "..config.max_summons.."x "..config.monster_name..".")
	else
		doPlayerSendCancel(cid, "You can only summon max "..config.max_summons.."x "..config.monster_name.."s.")
	end	
	else
		local ret = doCreateMonster(config.monster_name, getThingPos(cid),true)
		doSendMagicEffect(getThingPos(ret), CONST_ME_TELEPORT)
		doConvinceCreature(cid, ret)
		doRemoveItem(item.uid,1)
	end
	return true
end

Enjoy!
 
@UP
That script will create a wild monster and its badly made, you dont need to define the itemid when you already doing it in the xml and you dont need to put else if, they dont have the item, they wont be able to create so why put else?

----My Script----

I hope this will fulfill your needs!

First go to actions/actions.xml and paste the line below:
XML:
<action itemid="12597" event="script" value="pet_summon.lua"/>

Now go to actions/scripts and create new lua and name it "pet_summon.lua" and paste the code below:
Lua:
local config = {
	monster_name = "Lizard Snakecharmer",
	max_summons = 1
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getTileInfo(getThingPos(cid)).protection) then   
		return (doPlayerSendCancel(cid, "You can't use this item in protection zone.") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF))
	end
	if (#getCreatureSummons(cid) >= config.max_summons) then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	if (config.max_summons <= 1) then
		doPlayerSendCancel(cid, "You can only summon max "..config.max_summons.."x "..config.monster_name..".")
	else
		doPlayerSendCancel(cid, "You can only summon max "..config.max_summons.."x "..config.monster_name.."s.")
	end	
	else
		local ret = doCreateMonster(config.monster_name, getThingPos(cid),true)
		doSendMagicEffect(getThingPos(ret), CONST_ME_TELEPORT)
		doConvinceCreature(cid, ret)
		doRemoveItem(item.uid,1)
	end
	return true
end

Enjoy!

i did this and it attacked me ;3
 
Well, you need to make sure in the monster folder {Lizard Snakecharmer.xml} the <flag convinceable="1"/> and not 0.
 
Back
Top