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

summon

foxkbt

Member
Joined
Sep 29, 2009
Messages
290
Reaction score
7
Location
Salvador
HELOO GUYS

I need a function that removes a summon and summon another creature

i try in thats form but dosent work
"when I use the magic only removes the summon"

function doRemoveCreatureSummon(cid, name)
if isCreature(cid) and type(name) == "string" then
for _, sid in ipairs(getCreatureSummons(cid)) do
if getCreatureName(sid):lower() == name:lower() then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return doRemoveCreature(sid)
end
end
end
end
function onCastSpell(cid, var)
if getPlayerItemCount(cid, 11417) >= 20 and doRemoveCreatureSummon(cid, "Wolf") then
if getPlayerLevel(cid) >= 200 then
doConvinceCreature(cid, doSummonCreature("quimera cerberus", cid))
end
end
end
 
try this;
Code:
function doRemoveCreatureSummons(cid, name)
	if isCreature(cid) and type(name) == "string" then
		local c = getCreatureSummons(cid)
		if #c > 0 then
			for i, v in ipairs(c) do
				doRemoveCreature(v)
			end
		end
		doSummonCreature(name, getThingPos(cid))
	end
	return true
end
 
Back
Top