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

Add one function

Azor

Cze
Joined
Dec 14, 2008
Messages
106
Reaction score
0
Location
Poland > Zachodniopomorskie > Police
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2121 then
local pos =	getCreaturePosition(cid)
local monster = doCreateMonster("demon", pos)
doConvinceCreature(cid, monster)
return 1
end
end
I need to create effect on the position, where demon appear. How to do?
 
Simple Effect With Fire Ball.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2121 then
local pos =	getCreaturePosition(cid)
local monster = doCreateMonster("demon", pos)
doSendMagicEffect(fromPosition, CONST_ME_FIREAREA)
doConvinceCreature(cid, monster)
return 1
end
end

If like rep ;P
 
Code:
local monster = doCreateMonster("demon", pos.x + 1)
If I do this, summon does not apper.
[12/11/2009 19:33:33] attempt to index a number value
[12/11/2009 19:33:33] stack traceback:
[12/11/2009 19:33:33] [C]: in function 'doCreateMonster'
[12/11/2009 19:33:33] data/actions/scripts/omg/summon.lua:4: in function <data/actions/scripts/omg/summon.lua:1>
 
Code:
local monster = doCreateMonster("demon", pos.x + 1)
If I do this, summon does not apper.


Hmm try this one...

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2121 then
doSendMagicEffect(fromPosition, CONST_ME_FIREAREA)
local pos =     getCreaturePosition(cid)
local monster = doCreateMonster("demon", pos.x + 1)
doConvinceCreature(cid, monster)
return 1
end
end
 
Lua:
  function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2121 then
local pos =     getCreaturePosition(cid)
local monster = doCreateMonster("demon", pos)
doSendMagicEffect(getCreaturePosition(monster), CONST_ME_FIREAREA)
doConvinceCreature(cid, monster)
return 1
end
end
 
Back
Top