• 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] limit One use, till creature death . Action script on item use. HELP

Blood BlvD Ot

Member
Joined
Jun 12, 2010
Messages
243
Reaction score
7
I got it set up so u can summon the creature on item use.
I need it so that u can only summon one creature on using this, and u cannot summon again untill that creature has died or gone away on the event of a player log off.

This is the beginning of what we've got.

Code:
function onUse(cid, item, frompos, item2, topos)


local pos = getThingPos(cid)

if item.itemid == # then


	doConvinceCreature(cid, doCreateMonster("SUMMON", pos))
 

else
doPlayerSendCancel(cid,"MESSAGE")
end
	doSendMagicEffect(topos,40)
return 1
end

function
 
I got it set up so u can summon the creature on item use.
I need it so that u can only summon one creature on using this, and u cannot summon again untill that creature has died or gone away on the event of a player log off.

This is the beginning of what we've got.

Code:
function onUse(cid, item, frompos, item2, topos)


local pos = getThingPos(cid)

if item.itemid == # then


	doConvinceCreature(cid, doCreateMonster("SUMMON", pos))
 

else
doPlayerSendCancel(cid,"MESSAGE")
end
	doSendMagicEffect(topos,40)
return 1
end

function

LUA:
if table.maxn(getCreatureSummons(cid)) > 1 then
	doPlayerSendCancel(cid, "You can't summon more.")
else
	doConvinceCreature(blabla)
end

Or...

LUA:
if table.maxn(getCreatureSummons(cid)) > 1 then
	for _, s  in ipairs(getCreatureSummons(cid)) do
		if getCreatureName(s) == "SUMMON NAME" then
			doPlayerSendCancel(cid, "You've already summoned " .. SUMMON NAME .. ".")
		else
			doConvinceblabla...
		end
	end
end
 
This is the working script :

function onUse(cid, item, frompos, item2, topos)


local pos = getThingPos(cid)

if table.maxn(getCreatureSummons(cid)) > 0 then

doPlayerSendCancel(cid, "You can't summon more.")

else

doConvinceCreature(cid, doCreateMonster("Yeti", pos))

end

return 1

end
 
LUA:
function onUse(cid, item, frompos, item2, topos)
local pos = getThingPos(cid)
    if(getTilePzInfo(getCreaturePosition(cid)) == true) then
            doCreatureSay(cid, "You cannot use in PZ!", TALKTYPE_ORANGE_1)
        return true
    end
    if table.maxn(getCreatureSummons(cid)) > 0 then
            doPlayerSendCancel(cid, "You can't summon more.")
    else
            doConvinceCreature(cid, doCreateMonster("Yeti", pos))
    end
 return true
end
 
Back
Top