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

dzwignia usuwajaca kilka scian

Status
Not open for further replies.

Volume

New Member
Joined
Sep 26, 2009
Messages
35
Reaction score
0
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=1082, y=1124, z=7, stackpos=1}
getgate = getThingfromPos(gatepos)
if item.uid == 3001 and item.itemid == 1945 and getgate.itemid == 1353 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 3001 and item.itemid == 1946
and getgate.itemid == 0 then
doCreateItem(1353,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end

pomoze mi ktos przerobic tego skrypta tak zeby byla mozliwosc usuwania jednoczesnie kilku scian?za pomoc oczewiscie rep+
 
Code:
function onUse(cid, item, frompos, item2, topos)
	local gatepos = {x=1082, y=1124, z=7, stackpos=1}
	local gate2pos = {x=1082, y=1124, z=7, stackpos=1}
	local getgate = getThingfromPos(gatepos)
	local getgate2 = getThingfromPos(gate2pos)

	if item.uid == 3001 and item.itemid == 1945 and getgate.itemid == 1353 and getgate2.itemid == 1353 then
		doRemoveItem(getgate,1)
		doRemoveItem(getgate2,1)
		doTransformItem(item.uid,item.itemid+1)
	elseif item.uid == 3001 and item.itemid == 1946
		and getgate.itemid == 0 then
		doCreateItem(1353,1,gatepos)
		doCreateItem(1353,1,gatepos2)
		doTransformItem(item.uid,item.itemid-1)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
	end
return 1
end

Repucik mile widziany :)
 
pojawil sie pewien blad w silniku a mianowicie:


[18/09/2009 10:52:09] Lua Script Error: [Action Interface]
[18/09/2009 10:52:09] data/actions/scripts/dzwignia1.lua:onUse

[18/09/2009 10:52:09] luaDoRemoveItem(). Item not found
 
Code:
function onUse(cid, item, frompos, item2, topos)
	local gatepos = {x=1082, y=1124, z=7, stackpos=1}
	local gate2pos = {x=1082, y=1124, z=7, stackpos=1}
	local getgate = getThingfromPos(gatepos)
	local getgate2 = getThingfromPos(gate2pos)

	if item.uid == 3001 and item.itemid == 1945 and getgate.itemid == 1353 and getgate2.itemid == 1353 then
		doRemoveItem(getgate.uid,1)
		doRemoveItem(getgate2.uid,1)
		doTransformItem(item.uid,item.itemid+1)
	elseif item.uid == 3001 and item.itemid == 1946
		and getgate.itemid == 0 then
		doCreateItem(1353,1,gatepos)
		doCreateItem(1353,1,gatepos2)
		doTransformItem(item.uid,item.itemid-1)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
	end
return 1
end

poprawilem.
 
ok teraz znikaja ale mozesz mi jeszcze pomoc bo te sciany znikaja ale gdy pociagne wajcha jeszcze raz to sie nie pojawiaja(znikaja ale pozniej wajcha sie zacina i nie chca sie pojawic)
blad w silniku:


[18/09/2009 11:36:39] Lua Script Error: [Action Interface]
[18/09/2009 11:36:39] data/actions/scripts/dzwignia1.lua:onUse

[18/09/2009 11:36:39] attempt to index a nil value
[18/09/2009 11:36:39] stack traceback:
[18/09/2009 11:36:39] [C]: in function 'doCreateItem'
[18/09/2009 11:36:39] data/actions/scripts/dzwignia1.lua:14: in function <data/actions/scripts/dzwignia1.lua:1>
 
Code:
function onUse(cid, item, frompos, item2, topos)
	local gatepos = {x=1082, y=1124, z=7, stackpos=1} // pozycja 1 kamienia
	local gate2pos = {x=1082, y=1124, z=7, stackpos=1} // pozycja 2 kamienia
	local getgate = getThingfromPos(gatepos)
	local getgate2 = getThingfromPos(gate2pos)

	if item.uid == 3001 and item.itemid == 1945 and getgate.itemid == 1353 and getgate2.itemid == 1353 then
		doRemoveItem(getgate,1)
		doRemoveItem(getgate2,1)
		doTransformItem(item.uid,item.itemid+1)
	elseif item.uid == 3001 and item.itemid == 1946
		and getgate.itemid == 0 and getgate2.itemid == 0  then
		doCreateItem(1353,1,gatepos)
		doCreateItem(1353,1,gatepos2)
		doTransformItem(item.uid,item.itemid-1)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
	end
return 1
end
 
Last edited:
teraz w ogole sie nic nie dzieje ;/ wajcha mozna ruszac ale sciana nie znika
 
LUA:
local gates =
{
	{x = 1082, y = 1124, z = 7},
	{x = 1082, y = 1124, z = 7},
	{x = 1082, y = 1124, z = 7}
}

function onUse(cid, item, frompos, item2, topos)
	for i, v in ipairs(gates) do
		if(item.itemid == 1945) then
			local gate = getTileItemById(v[i], 1353)
			doRemoveItem(gate.uid, 1)
			doTransformItem(item.uid, item.itemid + 1)
		else
			doCreateItem(1353, 1, v[i])
			doTransformItem(item.uid, item.itemid - 1)
		end
	end
	return true
end
Pomoc raz w miesiącu zaliczona i spokój.
 
nie jest dobrze w silniku mam bledy
[18/09/2009 13:46:25] Lua Script Error: [Action Interface]
[18/09/2009 13:46:25] data/actions/scripts/dzwignia1.lua:onUse

[18/09/2009 13:46:25] attempt to index a nil value
[18/09/2009 13:46:25] stack traceback:
[18/09/2009 13:46:25] [C]: in function 'getTileItemById'
[18/09/2009 13:46:25] data/actions/scripts/dzwignia1.lua:10: in function <data/actions/scripts/dzwignia1.lua:7>
 
A terasz?
Code:
local gates =
{
	{x = 1082, y = 1124, z = 7},
	{x = 1082, y = 1124, z = 7},
	{x = 1082, y = 1124, z = 7}
}

function onUse(cid, item, frompos, item2, topos)
	for i, v in ipairs(gates) do
		if(item.itemid == 1945) then
			local gate = getTileItemById(v, 1353)
			doRemoveItem(gate.uid, 1)
			doTransformItem(item.uid, item.itemid + 1)
		else
			doCreateItem(1353, 1, v)
			doTransformItem(item.uid, item.itemid - 1)
		end
	end
	return true
end
 
Status
Not open for further replies.
Back
Top