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

Script not working.

azzkaban

Monster Maker
Joined
Feb 23, 2010
Messages
1,101
Reaction score
194
Location
Iquique Chile
This script not working in 9.44 :(

can you help me?

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

itempos = {x=271, y=678, z=7, stackpos=1}
itemid = 8291
item3 = getThingfromPos(itempos)
item2pos = {x=272, y=678, z=7, stackpos=1}
item2id = 8575
item4 = getThingfromPos(item2pos)
item3pos = {x=270, y=678, z=7, stackpos=1}
item3id = 8776
item5 = getThingfromPos(item3pos)
item4pos = {x=269, y=677, z=7, stackpos=1}
item4id = 8289
item6 = getThingfromPos(item4pos)
item5pos = {x=270, y=677, z=7, stackpos=1}
item5id = 8773
item7 = getThingfromPos(item5pos)
item6pos = {x=272, y=677, z=7, stackpos=1}
item6id = 8774
item8 = getThingfromPos(item6pos)
item7pos = {x=273, y=677, z=7, stackpos=1}
item7id = 8290
item9 = getThingfromPos(item7pos)
item8pos = {x=272, y=676, z=7, stackpos=1}
item8id = 8771
item10 = getThingfromPos(item8pos)
item9pos = {x=271, y=676, z=7, stackpos=1}
item9id = 8272
item11 = getThingfromPos(item9pos)


if item.itemid == 1954 then
doTransformItem(item.uid,1955)
doRemoveItem(item3.uid,1)
doRemoveItem(item5.uid,1)
doCreateItem(item5id,1,item5pos)
doCreateItem(item6id,1,item6pos)
doCreateItem(item7id,1,item7pos)
doCreateItem(item8id,1,item8pos)

elseif item.itemid == 1955 then
doTransformItem(item.uid,1954)
doCreateItem(itemid,1,itempos)
doCreateItem(item2id,1,item2pos)
doCreateItem(item3id,1,item3pos)
doCreateItem(item4id,1,item4pos)
doCreateItem(item9id,1,item6pos)
doCreateItem(item9id,1,item7pos)

end

return 1
end

Can you pass a mod.xml?

Thank you.
 
Are you using levers?
If yes remember IDs are 1945 and 1946 (not 1954 and 1955)
Anyway, I remade it:
Lua:
local t = { 
[8291] = {x=271, y=678, z=7, stackpos=1},
[8575] = {x=272, y=678, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8272] = {x=271, y=676, z=7, stackpos=1}
}
function onUse(cid, item, frompos, item2, topos)
for k, v in pairs(t) do
	if item.itemid == 1954 then
		doRemoveItem(getThingfromPos(v)).uid, 1)
	else
		doCreateItem(k,1,v)
	end
end
return doTransformItem(item.itemid == 1954 and 1955 or 1954) and true
end
 
Are you using levers?
If yes remember IDs are 1945 and 1946 (not 1954 and 1955)
Anyway, I remade it:
Lua:
local t = { 
[8291] = {x=271, y=678, z=7, stackpos=1},
[8575] = {x=272, y=678, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8272] = {x=271, y=676, z=7, stackpos=1}
}
function onUse(cid, item, frompos, item2, topos)
for k, v in pairs(t) do
	if item.itemid == 1954 then
		doRemoveItem(getThingfromPos(v)).uid, 1)
	else
		doCreateItem(k,1,v)
	end
end
return doTransformItem(item.itemid == 1954 and 1955 or 1954) and true
end


Loading ACTIONS MOD.xml ...[Error - LuaInterface::loadFile] mods/scripts/actions mod/murniasewer.lua:15: unexpected symbol near '1'
[17/8/2012 4:15:14] [Error - Event::checkScript] Cannot load script (mods/scripts/actions mod/murniasewer.lua)
[17/8/2012 4:15:14] mods/scripts/actions mod/murniasewer.lua:15: unexpected symbol near '1'

Yes, is lever!

lever.jpg
 
Last edited:
Loading ACTIONS MOD.xml ...[Error - LuaInterface::loadFile] mods/scripts/actions mod/murniasewer.lua:15: unexpected symbol near '1'
[17/8/2012 4:15:14] [Error - Event::checkScript] Cannot load script (mods/scripts/actions mod/murniasewer.lua)
[17/8/2012 4:15:14] mods/scripts/actions mod/murniasewer.lua:15: unexpected symbol near '1'

Yes, is lever!

View attachment 15358

change
Lua:
doRemoveItem(getThingfromPos(v)).uid, 1)
to
Lua:
doRemoveItem(getThingfromPos(v).uid,1)

--edit
Don't forget to change itemids as Santi said. You're using levers. Not a paper
 
Last edited:
try changed
Lua:
doRemoveItem(getThingfromPos(v)).uid, 1)
for
Lua:
doRemoveItem(getThingfromPos(t[v]).uid, 1)
or
Lua:
doRemoveItem(getThingfromPos(v).uid, 1)
 
[17/8/2012 4:46:44] [Error - Action Interface]
[17/8/2012 4:46:44] mods/scripts/actions mod/murniasewer.lua:eek:nUse
[17/8/2012 4:46:44] Description:
[17/8/2012 4:46:44] (luaDoRemoveItem) Item not found

[17/8/2012 4:46:44] [Error - Action Interface]
[17/8/2012 4:46:44] mods/scripts/actions mod/murniasewer.lua:eek:nUse
[17/8/2012 4:46:45] Description:
[17/8/2012 4:46:45] (luaDoTransformItem) Item not found


Maybe I need change position :D

Look picture :D
lever.jpg

mmm, not, but remove ground...
 
yes need edit positions your edit this?
Lua:
[8291] = {x=271, y=678, z=7, stackpos=1},
[8575] = {x=272, y=678, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8272] = {x=271, y=676, z=7, stackpos=1}
 
Same position

itempos = {x=271, y=678, z=7, stackpos=1}
itemid = 8291
item3 = getThingfromPos(itempos)
item2pos = {x=272, y=678, z=7, stackpos=1}
item2id = 8575
item4 = getThingfromPos(item2pos)
item3pos = {x=270, y=678, z=7, stackpos=1}
item3id = 8776
item5 = getThingfromPos(item3pos)
item4pos = {x=269, y=677, z=7, stackpos=1}
item4id = 8289
item6 = getThingfromPos(item4pos)
item5pos = {x=270, y=677, z=7, stackpos=1}
item5id = 8773
item7 = getThingfromPos(item5pos)
item6pos = {x=272, y=677, z=7, stackpos=1}
item6id = 8774
item8 = getThingfromPos(item6pos)
item7pos = {x=273, y=677, z=7, stackpos=1}
item7id = 8290
item9 = getThingfromPos(item7pos)
item8pos = {x=272, y=676, z=7, stackpos=1}
item8id = 8771
item10 = getThingfromPos(item8pos)
item9pos = {x=271, y=676, z=7, stackpos=1}
item9id = 8272
item11 = getThingfromPos(item9pos)




error:

[17/8/2012 5:36:7] [Error - Action Interface]
[17/8/2012 5:36:7] mods/scripts/actions mod/murniasewer.lua:eek:nUse
[17/8/2012 5:36:7] Description:
[17/8/2012 5:36:7] attempt to index a nil value
[17/8/2012 5:36:7] stack traceback:
[17/8/2012 5:36:7] [C]: in function 'getThingfromPos'
[17/8/2012 5:36:7] mods/scripts/actions mod/murniasewer.lua:15: in function <mods/scripts/actions mod/murniasewer.lua:12>

[17/8/2012 5:36:14] [Error - Action Interface]
[17/8/2012 5:36:14] mods/scripts/actions mod/murniasewer.lua:eek:nUse
[17/8/2012 5:36:14] Description:
[17/8/2012 5:36:14] (luaDoTransformItem) Item not found
 
This shouldn't have any syntax or functional errors, somehow it's not indexing values, maybe I'm missing something but I ain't got time to test it and stuff /:
Lua:
local t = { 
[8291] = {x=271, y=678, z=7, stackpos=1},
[8575] = {x=272, y=678, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8272] = {x=271, y=676, z=7, stackpos=1}
}
function onUse(cid, item, frompos, item2, topos)
for k, v in pairs(t) do
	if item.itemid == 1945 then
		doRemoveItem(getThingfromPos(v).uid, 1)
	else
		doCreateItem(k,1,v)
	end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) and true
end
 
This shouldn't have any syntax or functional errors, somehow it's not indexing values, maybe I'm missing something but I ain't got time to test it and stuff /:
Lua:
local t = { 
[8291] = {x=271, y=678, z=7, stackpos=1},
[8575] = {x=272, y=678, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8272] = {x=271, y=676, z=7, stackpos=1}
}
function onUse(cid, item, frompos, item2, topos)
for k, v in pairs(t) do
	if item.itemid == 1945 then
		doRemoveItem(getThingfromPos(v).uid, 1)
	else
		doCreateItem(k,1,v)
	end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) and true
end


AMAZING!!!! :D

Script is perfect, but look picture:

179181_127066144102114_1490686192_n-copia.jpg



1- Demon Oak I need remove
2- No Demon Oak Perfect!!!!!
3- Back Demon Oak, + lich corpse



I try edit positions :D Wait me.

OK!!! Script is perfect!!!

Lua:
local t = { 
[8288] = {x=271, y=675, z=7, stackpos=1},
[8770] = {x=270, y=676, z=7, stackpos=1},
[8772] = {x=271, y=676, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8775] = {x=272, y=678, z=7, stackpos=1},
[8291] = {x=271, y=678, z=7, stackpos=1}
}
function onUse(cid, item, frompos, item2, topos)
for k, v in pairs(t) do
	if item.itemid == 1945 then
		doRemoveItem(getThingfromPos(v).uid, 1)
	else
		doCreateItem(k,1,v)
	end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) and true
end

Is possible pass in MOD?
 
Last edited:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Demon Oak" enabled="yes">
<action uniqueid="2297"><![CDATA[

local t = { 
[8288] = {x=271, y=675, z=7, stackpos=1},
[8770] = {x=270, y=676, z=7, stackpos=1},
[8772] = {x=271, y=676, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8775] = {x=272, y=678, z=7, stackpos=1},
[8291] = {x=271, y=678, z=7, stackpos=1}
}
function onUse(cid, item, frompos, item2, topos)
for k, v in pairs(t) do
	if item.itemid == 1945 then
		doRemoveItem(getThingfromPos(v).uid, 1)
	else
		doCreateItem(k,1,v)
	end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) and true
end

]]></action>
</mod>

If you're using actionID then change it up there @line 3
 
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Demon Oak" enabled="yes">
<action uniqueid="2297"><=!=[=C=D=A=T=A=[

local t = { 
[8288] = {x=271, y=675, z=7, stackpos=1},
[8770] = {x=270, y=676, z=7, stackpos=1},
[8772] = {x=271, y=676, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8775] = {x=272, y=678, z=7, stackpos=1},
[8291] = {x=271, y=678, z=7, stackpos=1}
}
function onUse(cid, item, frompos, item2, topos)
for k, v in pairs(t) do
	if item.itemid == 1945 then
		doRemoveItem(getThingfromPos(v).uid, 1)
	else
		doCreateItem(k,1,v)
	end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) and true
end

]=]=></action>
</mod>

If you're using actionID then change it up there @line 3

MOD Not working :D
 
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Demon Oak" version="1.0" author="Santi" contact="otland.net" enabled="yes">
	<action itemid="xxxx" event="script" override="yes"><![CDATA[
		local t = { 
[8288] = {x=271, y=675, z=7, stackpos=1},
[8770] = {x=270, y=676, z=7, stackpos=1},
[8772] = {x=271, y=676, z=7, stackpos=1},
[8771] = {x=272, y=676, z=7, stackpos=1},
[8290] = {x=273, y=677, z=7, stackpos=1},
[8289] = {x=269, y=677, z=7, stackpos=1},
[8773] = {x=270, y=677, z=7, stackpos=1},
[8776] = {x=270, y=678, z=7, stackpos=1},
[8774] = {x=272, y=677, z=7, stackpos=1},
[8775] = {x=272, y=678, z=7, stackpos=1},
[8291] = {x=271, y=678, z=7, stackpos=1}
}
function onUse(cid, item, frompos, item2, topos)
for k, v in pairs(t) do
	if item.itemid == 1945 then
		doRemoveItem(getThingfromPos(v).uid, 1)
	else
		doCreateItem(k,1,v)
	end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) and true
end
	]]></action>
</mod>

Only edit
Lua:
<action itemid="xxxx" event="script" override="yes">
for itemid ="" <- your ID
 
Back
Top