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

Lua [Problem] with Script of Resurection for undeads.

Obsdark

Member
Joined
Sep 25, 2011
Messages
213
Reaction score
9
¡¡¡Hey Oh!!!

I'm Making one script who works each time you kill some type of undeads, when the body apparead on the floor this script must (but don't do it) count some seconds, after that the body dissapeard and two of that kind of undead are summon in that place, this happends not necesarely after kill one undead, but when the undead body stays on the ground, that trigger the sistem.

i'm not sure if what i'm making it wrong, it keeps sending me the same error message over and over again "error in line 26" which is:

LUA:
local r = t(moveitem.id)

Can you help me a little bit?, i really apreciate it ;)
this is the code who must do that:

LUA:
local t = {
[2853] = "Ghoul",
[2854] = "Ghoul",
[9654] = "Vampire Bride",
[9658] = "Vampire Bride",
[9659] = "Vampire Bride",
[2956] = "Vampire",
[2957] = "Vampire",
[2949] = "mummy",
[2950] = "mummy",
[2951] = "mummy",
[3025] = "lich",
[3026] = "lich",
[2998] = "Banshee",
[2999] = "Banshee",
[3000] = "Banshee",
[9876] = "Zombie",
[9877] = "Zombie",
[8956] = "Grim Reaper",
[8957] = "Grim Reaper",
[6355] = "Blightwalker"
}
local m = {
tm = 10
}
local r = t(moveitem.id)
local function RemoveCorpse()
		if moveitem.itemid == t then
			doRemoveItem(t, 1)
			doSummonCreature(t.monster, pos)
			doSummonCreature(t.monster, pos)
			doSendMagicEffect(topos,12)
		end
		end
function onAddItem(cid, moveitem, tileitem, position)
if getTilePzInfo(t) == 0 then
 			addEvent(RemoveCorpse, m.tm, t)
end
return 1
end

¡Tnx a lot for everything!

¡Bless, Cheers and Happines!
(Y)(Y)

-Obsdark-
 
it took me sometime but, i didn't, and when i realize that was bad applied i change it, of course.. ;)
it's happend to me because i don't know how to use the "addevent" function, but now i learn and i can fix (and in fact, i'll do it) that problem/mistake. ;)

Well, i was going to fix/actualize the code just right now, this is the new code of the script who i need to fix now (including up-to-date image of the problem) ;):

bugfv.png


LUA:
local t = {
[2853] = "Ghoul", 2853,
[2854] = "Ghoul", 2854,
[9654] = "Vampire Bride", 9654,
[9658] = "Vampire Bride", 9658,
[9659] = "Vampire Bride", 9659,
[2956] = "Vampire", 2956,
[2957] = "Vampire", 2957,
[2949] = "mummy", 2949,
[2950] = "mummy", 2950,
[2951] = "mummy", 2951,
[3025] = "lich", 3025,
[3026] = "lich", 3026,
[2998] = "Banshee", 2998,
[2999] = "Banshee", 2999,
[3000] = "Banshee", 3000,
[9876] = "Zombie", 9876,
[9877] = "Zombie", 9877,
[8956] = "Grim Reaper", 8956,
[8957] = "Grim Reaper", 8957,
[6355] = "Blightwalker", 6355
}
local t(item.itemid)
function onAddItem(cid, moveitem, tileitem, position)
	if moveitem.itemid == t then
		addEvent(doRemoveItem, 0.125 * 1000, t.2, 1, pos)
		addEvent(doSummonCreature, 0.125 * 1000, t.1, pos)
		addEvent(doSummonCreature, 0.125 * 1000, t.1, pos)
		addEvent(doSendMagicEffect, 0.125 * 1000, topos,12)
	end
return 1
end



¡Tnx a lot For Everything, Since Now!
(Y)(Y)

-Obsdark-
 
I try what you say bogart, but then it says "sintax error near function" and doesn't want to load the script...


Now, it doesn't work, but at least is beeing loaded, the problem right now is this one:

bugzombie.png


it's happends after a while you kill a ghoul,... (the test monster i'm using for test this script)

& The Code, is this one:

LUA:
local t = {
[3113] = {"Ghoul", 3113},
[3114] = {"Ghoul", 3114},
[9654] = {"Vampire Bride", 9654},
[9658] = {"Vampire Bride", 9658},
[9659] = {"Vampire Bride", 9659},
[2956] = {"Vampire", 2956},
[2957] = {"Vampire", 2957},
[2949] = {"mummy", 2949},
[2950] = {"mummy", 2950},
[2951] = {"mummy", 2951},
[3025] = {"lich", 3025},
[3026] = {"lich", 3026},
[2998] = {"Banshee", 2998},
[2999] = {"Banshee", 2999},
[3000] = {"Banshee", 3000},
[9876] = {"Zombie", 9876},
[9877] = {"Zombie", 9877},
[8956] = {"Grim Reaper", 8956},
[8957] = {"Grim Reaper", 8957},
[6355] = {"Blightwalker", 6355}
}
local r = t[itemid]
pos = {x = 3252, y = 3027, z = 7}
function onAddItem(cid, moveitem, tileitem, position)
	if moveitem.itemid == r and tileitem.itemid == 9043 or 6386 or 424 or 6376 or 6378 or 407 or 3263 or 918 or 100 or 101 or 103 or 104 or 106 or 108 or 109 or 194 or 231 or 280 or 293 or 294 or 300 or 351 or 353 or 356 or 367 or 368 or 369 or 370 or 405 or 406 or 407 or 408 or 409 or 412 or 414 or 415 or 413 or 422 or 424 or 425 or 426 or 430 or 431 or 434 or 445 or 446 or 447 or 448 or 456 or 457 or 458 or 465 or 1016 or 1071 or 1072 or 1083 or 3139 or 3151 or 3152 or 3157 or 3158 or 3168 or 3169 or 3170 or 3172 or 3173 or 3176 or 3177 or 3178 or 3181 or 3182 or 3187 or 3188 or 3189 or 3190 or 3201 or 3216 or 3217 then
		addEvent(doRemoveItem, 1 * 1000, r[2], 1, pos)
		addEvent(doCreateMonster, 1 * 1000, r[1], pos)
		addEvent(doCreateMonster, 1 * 1000, r[1], pos)
		addEvent(doSendMagicEffect, 1 * 1000, topos,12)
	end
return 1
end

i Suspect that can be a problem with the position stuff..., but for make it work i need replace the "pos = {x = 3252, y = 3027, z = 7}" with some code than get the coords of the item, for set "pos" like that code and make it work, i guess btw..., Can someone know how to do it?

is there a function who can help me with that?



Note1: All the "Or Codes" are Tiles of the ground, any ground.

Note2: All the Table values are items, specify corpses.

¡Tnx to all the Help, Since Now!
(Y)(Y)

-Obsdark-
 
Last edited:
Back
Top