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

Solved Simple Lever Script to remove and replace stone not working

  • Thread starter Thread starter Xikini
  • Start date Start date
Status
Not open for further replies.
X

Xikini

Guest
0.3.6 Crying Damson

When I use the below script the lever will not move, and there is no error's in console.
I have tried for about 3 hours to create and fix this script to no avail. I am simply stumped.

The grey stone - itemid 1304 is on the square stonepos.
The lever has the uniqueid of 11200.

Please help :(

behemothlever.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
stonepos = {x=2162, y=2849, z=8, stackpos=1}
getpos = getThingfromPos(stonepos)
 
if item.uid == 11200 and item.itemid == 1945 and getpos.itemid == 1304 then
doRemoveItem(getpos.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 11200 and item.itemid == 1946 and getpos.itemid == 0 then
doCreateItem(1304,1,stonepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
return 1
end
LUA:
<action uniqueid="11200" event="script" value="levers/behemothlever.lua"/>
 
Last edited by a moderator:
Do you get the cancel message "Sorry not possible"?
Did you use lever id 1945 and is the stone there when you use the lever?
Is there something else on that position, like gravel/borders?
 
I do get the cancel message "Sorry not possible."

The tile which the stone is on only contains a single floor piece 354 - no borders or anything

The stone exists when the server starts.

Thank you for the help so far :)
 
There doesn't seem to be anything wrong with any syntax or anything in this script.
We know the script WORKS, as you say it says "Sorry not possible.".

Based on your conditions in the script, you must have:
  • The lever unique ID be 11200
  • The lever item ID be 1945
  • The rock item ID be 1304
  • The position of the rock must be x=2162, y=2849, z=8.
  • There must not be anything underneath the rock except a floor (no decoration, no borders)

Have you double-checked that these are correct?
 
13:11 You see a switch.
ItemID: [1945], UniqueID: [11200].
Position: [X: 2161] [Y: 2850] [Z: 9].

13:11 You see a stone.
ItemID: [1304].
Position: [X: 2161] [Y: 2849] [Z: 8].

stonepos = {x=2162, y=2849, z=8, stackpos=1}

ahhhhh fudge D:

It is fixed omg ty :D

I swear I checked the position like 90 times
:(
 
Status
Not open for further replies.
Back
Top