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

Lua Problem with parhment, can't move item!

Michaeel

New Member
Joined
Mar 6, 2009
Messages
272
Reaction score
1
Hey i have problem with parchment room quest.
Script works good. when i take parchment, scripts summons 4 demons but only GM can take parchment :S

parchment15.png


data/movemens/scripts/Demon-Edron-Summon4.lua
Code:
function onAddItem(moveitem, tileitem, position)
  if moveitem.itemid == 1953 then
    doRemoveItem(60999)
    parchment = {x=33063, y=31623, z=15}
    demon1pos = {x=33060, y=31623, z=15}
    demon2pos = {x=33066, y=31623, z=15}
    demon3pos = {x=33060, y=31627, z=15}
    demon4pos = {x=33066, y=31627, z=15}
    doSummonCreature("Demon", demon1pos)
    doSummonCreature("Demon", demon2pos)
    doSummonCreature("Demon", demon3pos)
    doSummonCreature("Demon", demon4pos)
	addEvent(doCreateItem,10000,1953,1,parchment)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made the demon lord angry and he summoned 4 demons around you.")
	end
	return TRUE
end

data/movements/movement.xml
Code:
 <movevent type="AddItem" event="script" actionid="60999" value="Demon-Edron-Summon4.lua"/>

What's wrong?
 
Well i deleted unique id and now i can move parchment and script summons 4 demons :)
But when i take parchment to backpack then script doesn't summon demons :/


And autonomously if i take parchment do bp or if i move to other place on map there is error in console:
parchment70.png


movements/summmon-demons.lua
Code:
function onAddItem(moveitem, tileitem, position)
  if moveitem.itemid == 1953 then
    doRemoveItem(60999)
    parchment = {x=33063, y=31623, z=15}
    demon1pos = {x=33060, y=31623, z=15}
    demon2pos = {x=33066, y=31623, z=15}
    demon3pos = {x=33060, y=31627, z=15}
    demon4pos = {x=33066, y=31627, z=15}
    doSummonCreature("Demon", demon1pos)
    doSummonCreature("Demon", demon2pos)
    doSummonCreature("Demon", demon3pos)
    doSummonCreature("Demon", demon4pos)
	addEvent(doCreateItem,10000,1953,1,parchment)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made the demon lord angry and he summoned 4 demons around you.")
	end
	return TRUE
end

movements/movement.xml
Code:
 <movevent type="AddItem" event="script" actionid="60999" value="Demon-Edron-Summon4.lua"/>

and how can i edit that parchment can spawn one time per 15minutes? cuz it spawns all time and someone can do 999999 demons
 
Hey i have in moevements/movements.xml this line:
Code:
	<movevent event="Equip" itemid="1953" slot="backpack" script="Demon-Edron-Summon4.lua"/>
but when i put parchment into backpack then script doesnt summons demons :/ whats wrong?
(when i move parchment to other place on map then script summons demons)
 
Code:
local t = {
	{x=33060, y=31623, z=15}, {x=33066, y=31623, z=15},
	{x=33060, y=31627, z=15}, {x=33066, y=31627, z=15}
}
function onAddItem(moveitem, tileitem, position, cid)
    doRemoveItem(moveitem.uid)
	for _, v in ipairs(t) do
		doSummonCreature("Demon", v)
	end
	addEvent(doItemSetAttribute, 10 * 1000, doCreateItem(1953, 1, {x=33063, y=31623, z=15}), "aid", 60999)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made the demon lord angry and he summoned 4 demons around you.")
end
 
Well when i move parchment to other place it works but when i take to backpack it doesn't
Code:
	<movevent event="Equip" itemid="1953" slot="backpack" script="Demon-Edron-Summon4.lua"/>
What's wrong here?
 
I have this in movements/movement.xml:
Code:
	<movevent event="Equip" uniqueid="60999" slot="backpack" script="Demon-Edron-Summon4.lua"/>
	<movevent event="DeEquip" uniqueid="60999" slot="backpack" script="Demon-Edron-Summon4.lua"/>

And it still doesn't work :/ it should summon 4 demons when i take parchment do backpack :/ why it doesnt work?
 
I have problem with this script :(
parchment83.png



Code:
local t = {
	{x=33060, y=31623, z=15}, {x=33066, y=31623, z=15},
	{x=33060, y=31627, z=15}, {x=33066, y=31627, z=15}
}
function onAddItem(moveitem, tileitem, position, cid)
    doRemoveItem(moveitem.uid)
	for _, v in ipairs(t) do
		doSummonCreature("Demon", v)
	end
	addEvent(doCreateItem(1953, 1, {x=33063, y=31623, z=15}), "aid", 60999)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made the demon lord angry and he summoned 4 demons around you.")
end

whats wrong?
 
Code:
local t, doEet = {
	{x=33060, y=31623, z=15}, {x=33066, y=31623, z=15},
	{x=33060, y=31627, z=15}, {x=33066, y=31627, z=15}
},
function()
	doItemSetAttribute(doCreateItem(1953, 1, {x=33063, y=31623, z=15}), "aid", 60999)
end
function onAddItem(moveitem, tileitem, position, cid)
 	doRemoveItem(moveitem.uid)
	for _, v in ipairs(t) do
		doSummonCreature("Demon", v)
	end
	addEvent(doEet, 30 * 60000)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made the demon lord angry and he summoned 4 demons around you.")
end
Also you should use ActionID for it in movements.xml and on map.
 
Oh thanks :) now there isnt error :)

In movements.xml: should id be:
Code:
<movevent type="AddItem" event="script" actionid="60999" value="summondemons.lua"/>
?


And how can I set: if someone takie parchment to backpack then active script
Code:
<movevent event="Equip" acionid="60999" slot="backpack" script="summondemons.lua"/>
it doesnt work :(
 
Last edited:
Or other (i think better) way
Is there any script which doesnt allow to wear/take to bp parchment?
-> players can only move it, like football
 
Ok thanks:) but how can I set it:
<movevent event="Equip" acionid="60999" slot="backpack" script="summondemons.lua"/>

it doesnt work.. if someone pick parchment up then parchment doesnt disappear and demons are not summoned :(
 
Yea i've put actionid in map editor
Code:
<movevent type="Equip" actionid="60999" event="script" slot="backpack" value="summondemons.lua"/>
Whats wrong now?:(
 
Back
Top