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

Lua i need a little help please

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15
Hey whats going on, please i need some help, im trying to do the bright sword quest with my scripts, also i got 2 working scripts the barrel and wall and the power ring remove wall

First:

Code:
local rPos = {x=32594, y=32214, z=9}
local rId = 2166
local wPos = {x=32604, y=32216, z=9}
local wId = 1061
local wTime = 20
function onUse(cid, item, fromPos, itemEx, toPos)
local getItem = getTileItemById(rPos, rId).uid
if getItem > 0 then
doRemoveItem(getThingFromPos(wPos).uid, 1)
addEvent(doCreateItem, wTime * 60 * 1000, wId, wPos)
else
doPlayerSendCancel(cid, "Necesitas el power ring.")
end
return true
end



Barrel Script

Code:
local pos = {x=32614, y=32209, z=10}
local wPos = {x=32614, y=32206, z=10}
local bId = 1770 
local wtime = 20
local wId = 1550
local rPos = {x=32613, y=32220, z=10}
local rId = 2166
function onUse(cid, item, fromPos, itemEx, toPos)
local getItem1, getItem2 = getTileItemById(rPos, rId).uid, getTileItemById(pos, bId).uid
if getItem1 > 0 and getItem2 > 0 then
doRemoveItem(getThingFromPos(wPos).uid, 1)
doRemoveItem(getItem2, 1)
doRemoveItem(getItem1, 1)
addEvent(doCreateItem, wTime * 60 * 1000, wId, wPos)
else
doPlayerSendCancel(cid, "No está el barril en la posición necesaria.")
end
return true
end

When i move levers, the walls dissapear, but i can walk across because the tile was removed 2, i need help seriously please some help!
 
can you tell me what do you want to do becaus i havent done that quest in ages maby i can help you.
is it you place a power ring on a spot and use lever then there a wall removes or remove the barrels?

you can use this example.
LUA:
function onUse(cid, item, frompos, item2, topos)
rPos = {x=32594, y=32214, z=9, stackpos=1}
getrPos = getThingfromPos(rPos)
if item.uid == 4519 and item.itemid == 1945 and getrPos.itemid == 2166 then
doTransformItem(item.uid,item.itemid+1)
doRemoveItem(getrPos.uid,1)
doSendMagicEffect(rPos, 4)
elseif item.uid == 4519 and item.itemid == 1946 and getrPos.itemid == 0 then
doCreateItem(2166,1,rPos)
doTransformItem(item.uid,item.itemid-1)		
		else
			doPlayerSendCancel(cid,"Sorry, not possible.")
		end

	return 1
end
you can add event time your self
 
Last edited:
the thing im trying to do is, when u put a power ring in pos x,y,z and shot the lever, dissapear a wall. id 1061, then u must put a barrel in pos x y z, when the barrel is in position u must shot other lever, with a power ring to, in the first action the power ring dissapear, in second power ring and barrel dissapear and they remove wall. the requeriment for move the 2 wall is the barrel and power ring was in a x y z position. like bright sword quest rl
 
1 -Wall for remove {x=32604, y=32216, z=9} Wall id 1061
1 - Ring position needed to use lever {x=32594, y=32214, z=9} id 2166/Power Ring
1 - Ring dissapear and wall to.
1 - Create again in 20 minutes

2 Wall for remove {x=32614, y=32206, z=10}
2 Ring position needed: {x=32613, y=32220, z=10} /id: 2166 / Power Ring
2 Barrel position needed: {x=32614, y=32209, z=10}
2 Lever: when u shot lever check for ring and barrel position and then dissapear the wall id 1550, ring 2166 and barrel 1770
2 create again in 20 minutes

thats all i guess
 
try this
* btw change the Uniqe id of the levers
LUA:
function onUse(cid, item, frompos, item2, topos)
wall1 = {x=32604, y=32216, z=9, stackpos=1}
getwall1 = getThingfromPos(wall1)
ring1 = {x=32594, y=32214, z=9, stackpos=1}
getring1 = getThingfromPos(ring1)
wallTime = 20
if item.uid == 4519 and item.itemid == 1945 and getwall1.itemid == 1061 and getring1.itemid == 2166 then
doTransformItem(item.uid,item.itemid+1)
doRemoveItem(getwall1.uid,1)
doRemoveItem(getring1.uid,1)
doSendMagicEffect(wall1, 4)
doSendMagicEffect(ring1, 4)
addEvent(doCreateItem, wallTime * 60 * 1000, 1061, wall1)
		else
			doPlayerSendCancel(cid,"Sorry, not possible.")
		end
 
	return 1
end
and the outher is
LUA:
function onUse(cid, item, frompos, item2, topos)
wall2 = {x=32614, y=32206, z=10, stackpos=1}
getwall2 = getThingfromPos(wall2)
ring2 = {x=32613, y=32220, z=10, stackpos=1}
getring2 = getThingfromPos(ring2)
wallTime = 20
barell = {x=32614, y=32209, z=10, stackpos=1}
getbarell = getThingfromPos(barell)
if item.uid == 4519 and item.itemid == 1945 and getwall2.itemid == 1550 and getring2.itemid == 2166 getbarell.itemid == 1770 then
doTransformItem(item.uid,item.itemid+1)
doRemoveItem(getwall2.uid,1)
doRemoveItem(getring2.uid,1)
doRemoveItem(getbarell.uid,1)
doSendMagicEffect(wall2, 4)
doSendMagicEffect(ring2, 4)
addEvent(doCreateItem, wallTime * 60 * 1000, 1550, wall2)
		else
			doPlayerSendCancel(cid,"Sorry, not possible.")
		end
 
	return 1
end
 
Last edited:
Back
Top