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

Kolejny problem ze skryptem actions

Status
Not open for further replies.

Xadrian

Active Member
Joined
Feb 24, 2008
Messages
905
Reaction score
26
Location
Poland, Stalowa Wola
Więc tak, prosty skrypt który powinien usuwać/tworzyć kamień oczywiście nie chce działać.

Skrypt:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local script = {
		[48001]={407, 714, 10},
		[48002]={408, 714, 10},
		[48003]={409, 714, 10},
		[48004]={410, 714, 10},
		[48005]={411, 714, 10},
	}
	local pos = {x=script[item.actionid][1], y=script[item.actionid][2], z=script[item.actionid][3], stackpos=1}	
	local stone = getThingFromPos(pos)
	
	if(item.itemid == 1955 and stone.itemid == 1304) then
	
		doTransformItem(item.uid, 1946, 1)
		doRemoveItem(stone.uid)
		
	elseif(item.itemid == 1956 and stone.itemid == nil) then
	
		doTransformItem(item.uid, 1945, 1)
		doCreateItem(1304, 1, pos)
		
	end
	return true
end

Gdy ruszam dźwignią nic się nie dzieje. 0 błędów w konsoli.
Może ktoś z Was poprawić ten skrypt/wskazać błąd?

+10 dla wyzwoliciela.

Pozdrawiam,
Xadrian.
 
Code:
local positions = {
	[48001] = {x = 407, y = 714, z = 10},
	[48002] = {x = 408, y = 714, z = 10},
	[48003] = {x = 409, y = 714, z = 10},
	[48004] = {x = 410, y = 714, z = 10},
	[48005] = {x = 411, y = 714, z = 10}
}
local stone_id = id kamienia
function onUse(cid, item, fromPosition, itemEx, toPosition)
		local position = positions[item.actionid]
		if(position) then
			local stone = getTileItemById(position, stone_id)
			if(item.itemid == 1945 and stone.itemid == 1304) then
				doTransformItem(item.uid, 1946, 1)
				doRemoveItem(stone.uid) 
			elseif(item.itemid == 1946 and not stone.uid) then
				doTransformItem(item.uid, 1945, 1)
				doCreateItem(1304, 1, position)
			end
		end
        return true
end
 
Code:
local positions = {
	[48001] = {x = 407, y = 714, z = 10},
	[48002] = {x = 408, y = 714, z = 10},
	[48003] = {x = 409, y = 714, z = 10},
	[48004] = {x = 410, y = 714, z = 10},
	[48005] = {x = 411, y = 714, z = 10}
}
local stone_id = id kamienia
function onUse(cid, item, fromPosition, itemEx, toPosition)
		local position = positions[item.actionid]
		if(position) then
			local stone = getTileItemById(position, stone_id)
			if(item.itemid == 1945 and stone.itemid == 1304) then
				doTransformItem(item.uid, 1946, 1)
				doRemoveItem(stone.uid) 
			elseif(item.itemid == 1946 and not stone.uid) then
				doTransformItem(item.uid, 1945, 1)
				doCreateItem(1304, 1, position)
			end
		end
        return true
end

Ja Ci to napisałem :huh:
 
Code:
local positions = {
	[48001] = {x = 407, y = 714, z = 10},
	[48002] = {x = 408, y = 714, z = 10},
	[48003] = {x = 409, y = 714, z = 10},
	[48004] = {x = 410, y = 714, z = 10},
	[48005] = {x = 411, y = 714, z = 10}
}
local stone_id = id kamienia
function onUse(cid, item, fromPosition, itemEx, toPosition)
		local position = positions[item.actionid]
		if(position) then
			local stone = getTileItemById(position, stone_id)
			if(item.itemid == 1945 and stone.itemid == 1304) then
				doTransformItem(item.uid, 1946, 1)
				doRemoveItem(stone.uid) 
			elseif(item.itemid == 1946 and not stone.uid) then
				doTransformItem(item.uid, 1945, 1)
				doCreateItem(1304, 1, position)
			end
		end
        return true
end

Świetnie czarnuchu, tylko czemu dźwignia nie chce wracać z powrotem i tworzyć znowu kamień?
 
Shit :<
Wywal:
Code:
and not stone.uid

;d

2nd time cie juz zawiodlem! xd
 
Status
Not open for further replies.
Back
Top