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

[spell] summoning monster spell

iksior

New Member
Joined
Jan 25, 2009
Messages
33
Reaction score
0
So i have this script but when i use this spell i can summon 10+ spiders, so what should i do to summon only 1 and other spell that summon 3 tarantulas in one use
Code:
function onCastSpell(cid, var)
 
local dir = getPlayerLookDir(cid)
local pos = getPlayerPosition(cid)
 
if(dir==1)then
	pos.x = pos.x + 1
elseif(dir==2)then
	pos.y = pos.y + 1
elseif(dir==3)then
	pos.x = pos.x - 1
elseif(dir==0)then
	pos.y = pos.y - 1
end
	doConvinceCreature(cid, doCreateMonster("Spider", pos))
	return true
end

it should work like that
Player: Spider (summons 1 spider)
and the other one
Player: Tarantula (summons 3 tarantulas).
 
Here, based on Cykotitan's script, so all credits to him:
LUA:
local max = 1
 
function onCastSpell(cid, var)
 
local dir = getPlayerLookDir(cid)
local ppos = getPlayerPosition(cid)
 
if(dir==1)then
	ppos.x = ppos.x + 1
elseif(dir==2)then
	ppos.y = ppos.y + 1
elseif(dir==3)then
	ppos.x = ppos.x - 1
elseif(dir==0)then
	ppos.y = ppos.y - 1
end
	local count, pos = #getCreatureSummons(cid), getThingPos(cid)
	if count == max then
		doPlayerSendCancel(cid, 'You cannot summon any more monsters.')
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end
 
		local v = doConvinceCreature(cid, doCreateMonster("spider", ppos))
	doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
	return true
end
Edit max as you want, and to summon the tarantulas just copy the whole la file and change the max and the creature name.
Credits for the script to Cykotian I just edited it to to fit your request.
 
ok so, if im useing spell summoning spider everything is ok coz i can summon only 1 spider, but then if im useing summon tarantula spell i can summon only 2 tarantulas
but if i use summon tarantula spell first i can summon spiders sipders all the time.
 
Back
Top