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

Item Summon Creature Convince

Saper1995

Technologic
Joined
Jul 11, 2009
Messages
104
Reaction score
3
Location
Poland
Hello Everybody !

I am writing to ask for help in explaining to me what is missing this script.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local pos = getPlayerPosition(cid)
	local summom = getCreatureSummons(cid)
	if(fromPosition.x ~= CONTAINER_POSITION) and item.itemid == 2122 then
		spawnEffect = math.random(6, 7)
		doRemoveItem(item.uid, 1)
	doSummonCreature(Djinn, pos)
		doSendMagicEffect(fromPosition, spawnEffect)
	elseif(fromPosition.x ~= CONTAINER_POSITION) == false and item.itemid == 2122 then
		doPlayerSendCancel(cid,"You may open this only on the ground.")
	end

	return true
end


This is a problem that I encountered as I want to create a MONSTER no NPC. Can anyone help? I do not know what I am doing wrong ... ;/
Code:
[02/03/2012 15:38:37] [Error - Action Interface] 
[02/03/2012 15:38:37] data/actions/scripts/aladin.lua:onUse
[02/03/2012 15:38:37] Description: 
[02/03/2012 15:38:37] (luaDoCreateNpc) Npc with name '' not found
 
@EDIT :) already did it,:) thank's for help ;)
But how to add function with max summon 1 monster ?.
just like : if i try click next time then i see "You can summon only one moster."

i try this but something don't work :
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = getPlayerPosition(cid)
local summons = getCreatureSummons(cid)
if(fromPosition.x ~= CONTAINER_POSITION) and item.itemid == 2122 then
spawnEffect = math.random(6, 6)
doRemoveItem(item.uid, 1)
local MyCreature = doSummonCreature("Djinn", pos)
doConvinceCreature(cid, MyCreature)
doSendMagicEffect(fromPosition, spawnEffect)
return MyCreature
elseif(fromPosition.x ~= CONTAINER_POSITION) == false and item.itemid == 2122 then
doPlayerSendCancel(cid,"You may open this only on the ground.")
local summons = getCreatureSummons(cid)
elseif summons >= 1 then
doPlayerSendCancel(cid,"You can have only one summon.")

end

return true
end
 
Last edited:
add this:
Code:
if #getCreatureSummons(cid) >= 1 then
doPlayerSendCancel(cid,"You can have only one summon.")
return true
end
 

Similar threads

Back
Top