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

Action LeverRemoveStone

freaked1

Active Member
Joined
Jan 30, 2008
Messages
486
Solutions
5
Reaction score
29
Location
Sweden
This is the script that I use for my DHQ, I modified a script that Maxwel1 had created(I guess) so that it worked fine,

copy this to actions.xml

Code:
<action uniqueid="9485" event="script" value="quests/dhq.lua"/>


create a file in scripts/quests named dhq.lua then add this into the file.

Code:
function onUse(cid, item, frompos, item2, topos)

local wallpos1 = {x=1170, y=981, z=11, stackpos=1} --- coordinates of the wall to be removed ---

local wall1 = getThingfromPos(wallpos1)

local wallID = 1354 --- item id of the wall to be removed ---


if item.uid == 9485 and item.itemid == 1945 and wall1.itemid == 1354 then

doRemoveItem(wall1.uid, 1)
doTransformItem(item.uid,1946)
doPlayerSendTextMessage(cid,22,"The stone has been removed.")


elseif item.uid == 9485 and item.itemid == 1946 and wall1.itemid == 0 then

doCreateItem(1354, 1, wallpos1)
doTransformItem(item.uid,1945)
doPlayerSendTextMessage(cid,22,"The stone is back on its position.")

return true
end
return true
end

NOTE: I'm not a scripter I just managed to fix this script to work for 0.3.6, since dhq didn't have any lever or stone I figured I had to do it myself, with some searching and modifying ;)

If this helped you feel free to rep++.
 
*updated
Lua:
local wallpos1 = {x=1170, y=981, z=11, stackpos=1} --- coordinates of the wall to be removed ---
local wallID = 1354 --- item id of the wall to be removed ---
local wall1 = getThingFromPos(wallpos1)

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 1945 and wall1.itemid == 1354 then
        doRemoveItem(wall1.uid, 1)
        doTransformItem(item.uid,1946)
        doPlayerSendTextMessage(cid,22,'The stone has been removed.')
    elseif item.itemid == 1946 and wall1.itemid == 0 then
        doCreateItem(1354, 1, wallpos1)
        doTransformItem(item.uid,1945)
        doPlayerSendTextMessage(cid,22,'The stone is back on its position.')
    end
    return true
end
 
ah thanks ;) I had 2
Code:
return true
cuz before when it was no return true I had to pull 2 times before it changed to the other lever ID :p
 
Back
Top