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

Lua Bright Sword Quest Script [ERROR] :<<<

frankfarmer

who'r ninja now
Premium User
Joined
Aug 5, 2008
Messages
1,581
Reaction score
81
Code:
-- remade script by frankfarmer
-- creator wellis
-- tested 0.3.6+
-- made for bright sword quest

function onUse(cid, item, frompos, item2, topos)
 
 
 -- start of configuration
local t = {
	switchUniqueID =  64164,  -- uniqueID of switch
	switchID = 1945, -- id of the switch
	switch2ID = 1946, -- id of switch after pulled
	interval = 2, -- how many minutes until the wall creates
	itemID = 2166, -- item that you need
	itempos = {x=32594, y=32214, z=9, stackpos=1}, -- position where you put the item
	wallpos = {x=32604, y=32216, z=9, stackpos=1}, -- where the wall is located
	wallnewID = 1103, -- id of the wall that will return after interval
	msg = "There is something missing", -- message players see when pulling lever and it don't work
	
	-- don't touch anything here!
	getitem = getThingfromPos(itempos),
	wallchk = getThingfromPos(wallpos)
 }
	if item.uid == t.switchUniqueID and t.item.itemid == switchID and t.getitem.itemid == itemID and t.wallchk.itemid == 1025 then
			doSendMagicEffect(t.itempos,10)
			doSendMagicEffect(t.wallchk,10)
			doRemoveItem(t.getitem.uid,1)
			doRemoveItem(t.wallchk.uid,1)
			doTransformItem(t.item.uid,t.item.itemid+1)
			addEvent(onTimer5, t.interval*60*1000)
	elseif item.uid == t.switchUniqueID and t.item.itemid == t.switch2ID then
			doTransformItem(item.uid,t.item.itemid-1)
	else
			doPlayerSendCancel(cid, t.msg, TALKTYPE_ORANGE_1)
end
	return 1
end


function onTimer5()

wallnewpos = {t.wallpos} 
doCreateItem(t.wallnewid,1,t.wallpos)

end

Im getting the error

errrrarararaarrararar.png


Anyone have a solution? Thanks
 
Code:
local t = {
	interval = 2,
	itemID = 2166,
	itempos = {x=32594, y=32214, z=9},
	wallpos = {x=32604, y=32216, z=9},
	wallnewID = 1103 -- why do you use a new id ? the quest won't be resettable
}
local event = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem, wallchk = getTileItemById(t.itempos, 2166).uid, getTileItemById(t.wallpos, 1025).uid
	if item.itemid == 1945 then
		if getitem > 0 and wallchk > 0 then
			doSendMagicEffect(t.itempos, CONST_ME_TELEPORT)
			doSendMagicEffect(t.wallpos, CONST_ME_TELEPORT)
			doRemoveItem(getitem)
			doRemoveItem(wallchk)
			doTransformItem(item.uid, 1946)
			event = addEvent(doCreateItem, t.interval * 60 * 1000, t.wallnewID, 1, t.wallpos)
		else
			doPlayerSendCancel(cid, "There is something missing.")
		end
	elseif item.itemid == 1946 then
		stopEvent(event)
		doCreateItem(t.wallnewID, 1, t.wallpos)
		doTransformItem(item.uid, 1945)
	end
	return TRUE
end
 
Last edited:
Code:
local t = {
	interval = 2,
	itemID = 2166,
	itempos = {x=32594, y=32214, z=9},
	wallpos = {x=32604, y=32216, z=9},
	wallnewID = 1103 -- why do you use a new id ? the quest won't be resettable
}
local event = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem, wallchk = getTileItemById(t.itempos, 2166).uid, getTileItemById(t.wallpos, 1025).uid
	if item.itemid == 1945 then
		if getitem > 0 and wallchk > 0 then
			doSendMagicEffect(t.itempos, CONST_ME_TELEPORT)
			doSendMagicEffect(t.wallchk, CONST_ME_TELEPORT)
			doRemoveItem(getitem)
			doRemoveItem(wallchk)
			doTransformItem(item.uid, 1946)
			event = addEvent(doCreateItem, t.interval * 60 * 1000, t.wallnewID, 1, t.wallpos)
		else
			doPlayerSendCancel(cid, "There is something missing.")
		end
	elseif item.itemid == 1946 then
		stopEvent(event)
		doCreateItem(t.wallnewID, 1, t.wallpos)
		doTransformItem(item.uid, 1945)
	end
	return TRUE
end

but I am trying to learn also. Can you explain why you changed and what you changed?

Thanks :wub::wub::wub:
 
Code:
local t = {
	interval = 2,
	itemID = 2166,
	itempos = {x=32594, y=32214, z=9},
	wallpos = {x=32604, y=32216, z=9},
	wallnewID = 1103 -- why do you use a new id ? the quest won't be resettable
}
local event = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem, wallchk = getTileItemById(t.itempos, 2166).uid, getTileItemById(t.wallpos, 1025).uid
	if item.itemid == 1945 then
		if getitem > 0 and wallchk > 0 then
			doSendMagicEffect(t.itempos, CONST_ME_TELEPORT)
			doSendMagicEffect(t.wallchk, CONST_ME_TELEPORT)
			doRemoveItem(getitem)
			doRemoveItem(wallchk)
			doTransformItem(item.uid, 1946)
			event = addEvent(doCreateItem, t.interval * 60 * 1000, t.wallnewID, 1, t.wallpos)
		else
			doPlayerSendCancel(cid, "There is something missing.")
		end
	elseif item.itemid == 1946 then
		stopEvent(event)
		doCreateItem(t.wallnewID, 1, t.wallpos)
		doTransformItem(item.uid, 1945)
	end
	return TRUE
end

Tested and does not work. When i put the power ring on the counter and pull the lever, there is nothing happening only a textmessage; "There is something missing"
 
Tested and does not work. When i put the power ring on the counter and pull the lever, there is nothing happening only a textmessage; "There is something missing"
as I said, it'll only work once per server reset, so you have to reset some wall yourself.
examine the script to see which one and which ID is required
 
as I said, it'll only work once per server reset, so you have to reset some wall yourself.
examine the script to see which one and which ID is required

testetst.png


with script

Code:
local t = {
	interval = 2,
	itemID = 2166,
	itempos = {x=32594, y=32214, z=9},
	wallpos = {x=32604, y=32216, z=9},
	wallnewID = 1103 -- why do you use a new id ? the quest won't be resettable
}
local event = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem, wallchk = getTileItemById(t.itempos, 2166).uid, getTileItemById(t.wallpos, 1103).uid
	if item.itemid == 1945 then
		if getitem > 0 and wallchk > 0 then
			doSendMagicEffect(t.itempos, CONST_ME_TELEPORT)
			doSendMagicEffect(t.wallchk, CONST_ME_TELEPORT)
			doRemoveItem(getitem)
			doRemoveItem(wallchk)
			doTransformItem(item.uid, 1946)
			event = addEvent(doCreateItem, t.interval * 60 * 1000, t.wallnewID, 1, t.wallpos)
		else
			doPlayerSendCancel(cid, "There is something missing.")
		end
	elseif item.itemid == 1946 then
		stopEvent(event)
		doCreateItem(t.wallnewID, 1, t.wallpos)
		doTransformItem(item.uid, 1945)
	end
	return TRUE
end
 
90320225.jpg

62128017.jpg


everything nicely, but I press on the lever as she vanishes and there is a black box. Please help.

PHP:
local t = {
	interval = 5,
	itemID = 2166,
	itempos = {x=32594, y=32214, z=9},
	wallpos = {x=32604, y=32216, z=9},
	wallnewID = 1026 -- why do you use a new id ? the quest won't be resettable
}
local event = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem, wallchk = getTileItemById(t.itempos, 2166).uid, getTileItemById(t.wallpos, 1026).uid
	if item.itemid == 1945 then
		if getitem > 0 and wallchk > 0 then
			doSendMagicEffect(t.itempos, CONST_ME_TELEPORT)
			doSendMagicEffect(t.wallpos, CONST_ME_TELEPORT)
			doRemoveItem(getitem)
			doRemoveItem(wallchk)
			doTransformItem(item.uid, 64164)
			event = addEvent(doCreateItem, t.interval * 60 * 1000, t.wallnewID, 1, t.wallpos)
		else
			doPlayerSendCancel(cid, "There is something missing.")
		end
	elseif item.itemid == 1946 then
		stopEvent(event)
		doCreateItem(t.wallnewID, 1, t.wallpos)
		doTransformItem(item.uid, 1945)
	end
	return TRUE
end
 
Back
Top