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

Pomocy ze skryptem, pilne!

Erevius

It Was A Good Day
Joined
Feb 12, 2010
Messages
157
Reaction score
7
Location
Poland/Olsztyn
Staram się zrobić skrypt podobny do tego na rooku, na ratach. Chodzi o dzwignie, ktora wysuwa most.
Mój skrypt jest nieco inny. Chodzi o to, aby po kliknięciu na dźwignie (jedną z dwóch; bez znaczenia na którą):
img1ln.png

2 płyty ściany zmieniają się w itemy o id: 1207,1208.
img2e.png


Mój skrypt:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)

lever1pos = {x=3087, y=2923, z=9}
lever1 = getThingFromPos(lever1pos)
lever2pos = {x=3087, y=2929, z=9}
lever2 = getThingFromPos(lever2pos)
wall1pos = {x=3089, y=2927, z=9}
wall1 = getThingFromPos(wall1pos)
wall2pos = {x=3091, y=2927, z=9}
wall2 = getThingFromPos(wall2pos)

	if item.itemid == 1945 then
		doTransformItem(lever1, 1946)
		doTransformItem(lever2, 1946)
		doTransformItem(wall1, 1207)
		doTransformItem(wall2, 1208)
	elseif item.itemid == 1946 then
		doTransformItem(lever1, 1945)
		doTransformItem(lever2, 1945)
		doTransformItem(wall1, 1034)
		doTransformItem(wall2, 1034)
	end
return true
end

Błąd w konsoli silnika (TFS 3.6):
Code:
[18/03/2011 23:55:34] [Error - Action Interface] 
[18/03/2011 23:55:34] data/actions/scripts/island of destiny/criptenter.lua:onUse
[18/03/2011 23:55:34] Description: 
[18/03/2011 23:55:34] (luaDoTransformItem) Item not found

[18/03/2011 23:55:34] [Error - Action Interface] 
[18/03/2011 23:55:34] data/actions/scripts/island of destiny/criptenter.lua:onUse
[18/03/2011 23:55:34] Description: 
[18/03/2011 23:55:34] (luaDoTransformItem) Item not found

[18/03/2011 23:55:34] [Error - Action Interface] 
[18/03/2011 23:55:34] data/actions/scripts/island of destiny/criptenter.lua:onUse
[18/03/2011 23:55:34] Description: 
[18/03/2011 23:55:34] (luaDoTransformItem) Item not found

[18/03/2011 23:55:34] [Error - Action Interface] 
[18/03/2011 23:55:34] data/actions/scripts/island of destiny/criptenter.lua:onUse
[18/03/2011 23:55:34] Description: 
[18/03/2011 23:55:34] (luaDoTransformItem) Item not found
 
A spróbuj tak, nie pamiętam czy dobrze .

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition) 

local lever1pos = {x=3087, y=2923, z=9} 
local lever1 = getThingFromPos(lever1pos).uid
local lever2pos = {x=3087, y=2929, z=9} 
local lever2 = getThingFromPos(lever2pos).uid
local wall1pos = {x=3089, y=2927, z=9}
local wall1 = getThingFromPos(wall1pos).uid 
local wall2pos = {x=3091, y=2927, z=9} 
local wall2 = getThingFromPos(wall2pos).uid

    if item.itemid == 1945 then 
        doTransformItem(lever1, 1946) 
        doTransformItem(lever2, 1946) 
        doTransformItem(wall1, 1207) 
        doTransformItem(wall2, 1208) 
    elseif item.itemid == 1946 then 
        doTransformItem(lever1, 1945) 
        doTransformItem(lever2, 1945) 
        doTransformItem(wall1, 1034) 
        doTransformItem(wall2, 1034) 
    end 
return true 
end

Można by krócej, ale piszesz o naprawdę problemu, więc ma działać :p.
 
Back
Top