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

Need Help With Summoning Convinsed Creature (ACTION SCRIPT)

Blood BlvD Ot

Member
Joined
Jun 12, 2010
Messages
243
Reaction score
7
Ok so this is what i have!

small details tho.

This is it :

Code:
pos = getPlayerPosition
Level = getPlayerLevel(cid)
Vocation = getPlayerVocation(cid)
if isInArray(deadlist, item2.itemid) == true and
Level >= 100 -- set the level requirement to be able to do Alchemy
then

rand = math.random(1,6000)

if rand <= 1000 and Level >= 50 then

		doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))

		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
elseif rand <= 2000 and Level >= 1000 then

		doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))

		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
elseif rand <= 3000 and Level >= 7500 then

		doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))

		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
elseif rand <= 4000 and Level >= 10000 then

		doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))

		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
elseif rand <= 5000 and Level >= 25000 then

		doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))

		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
elseif rand <= 6000 and Level >= 35000 then

		doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))

		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
elseif rand <= 6000 and Level >= 45000 then

		doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))

		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
elseif rand <= 6000 and Level >= 65000 then

		doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))

		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
end

doSendMagicEffect(topos,3)
doPlayerSay(cid,"Follow me my family! Its time to destroy!",1)
else
doPlayerSendCancel(cid,"This is not a useable corpse! report to Dan if it is.")
end
return 1
end)

thats the part of the script that I need To Fix

The script loads up fine, its just when i actualy use this action with the fuction :
Code:
function onUse(cid, item, frompos, item2, topos)

I get the error in my server log :

Code:
[28/07/2010 23:42:49] [Error - Action Interface] 
[28/07/2010 23:42:49] data/actions/scripts/bloodmage/lichstaff.lua:onUse
[28/07/2010 23:42:49] Description: 
[28/07/2010 23:42:49] attempt to index a function value
[28/07/2010 23:42:49] stack traceback:
[28/07/2010 23:42:50] 	[C]: in function 'doCreateMonster'
[28/07/2010 23:42:50] 	data/actions/scripts/bloodmage/lichstaff.lua:46: in function <data/actions/scripts/bloodmage/lichstaff.lua:11>

Any Idea?
 
Code:
local t = {
--	[lvl] = rand,
	[50] = 1000,
	[1000] = 2000,
	[7500] = 3000,
	[10000] = 4000,
	[25000] = 5000,
	[35000] = 6000,
	[45000] = 6000,
	[65000] = 6000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local Level = getPlayerLevel(cid)
	if isInArray(deadlist, itemEx.itemid) and Level >= 100 then -- set the level requirement to be able to do Alchemy
		local rand = math.random(6000)
		for lvl, rnd in pairs(t) do
			if rand <= rnd and Level >= lvl then
				local pos = getThingPos(cid)
				doConvinceCreature(cid, doCreateMonster("Flesh Eater", pos))
				doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
				break
			end
		end
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
		doCreatureSay(cid, 'Follow me my family! Its time to destroy!', TALKTYPE_SAY)
	else
		doPlayerSendCancel(cid, 'This is not a useable corpse! Report to Dan if it is.')
	end
	return true
end
 
The thing is i want it to do different mosnters at random and for it to add a mosnter to the random when the player is of a sertain level.

Can i Pm u the entire script?
 
Back
Top