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

Ani Quest

Dorianek

Member
Joined
Nov 29, 2018
Messages
252
Reaction score
10
Location
Poland
Hi, I have a problem with the lever on, neither the stone quest disappears when the player comes out the next can not open the stone the error pops up with the ruler (9)

Code:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=193, y=161, z=10, stackpos=1}
getgate = getThingfromPos(gatepos)

if item.uid == 9999 and item.itemid == 1945 and getgate.itemid == 1355 then
 doRemoveItem(getgate.uid,1)
 doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 9999 and item.itemid == 1946 and getgate.itemid == 0 then
 doCreateItem(1355,1,gatepos)
 doTransformItem(item.uid,item.itemid-1)
else
 doPlayerSendCancel(cid,"Cos blokuje ten kamien!")
end
return 1
end
 
Hi, I have a problem with the lever on, neither the stone quest disappears when the player comes out the next can not open the stone the error pops up with the ruler (9)

Code:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=193, y=161, z=10, stackpos=1}
getgate = getThingfromPos(gatepos)

if item.uid == 9999 and item.itemid == 1945 and getgate.itemid == 1355 then
 doRemoveItem(getgate.uid,1)
 doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 9999 and item.itemid == 1946 and getgate.itemid == 0 then
 doCreateItem(1355,1,gatepos)
 doTransformItem(item.uid,item.itemid-1)
else
 doPlayerSendCancel(cid,"Cos blokuje ten kamien!")
end
return 1
end
Try this.

LUA:
local stoneID = 1355
local stonePosition = {x = 193, y = 161, z = 10}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 1945 then
        doRemoveItem(getTileItemById(stonePosition, stoneID).uid)
    else
        doCreateItem(stoneID, 1, stonePosition)
    end
    doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
    return true
end
 
[C]: in function 'doCreateItem'
data/actions/scripts/dzwignia.lua:8: in function <data/actions/scripts/dzwignia.lua:4>

the lever opens the stone but after pressing it again does not close the stone so the senselessness after leaving in tp and after entering it is still impossible to move the lever
 
[C]: in function 'doCreateItem'
data/actions/scripts/dzwignia.lua:8: in function <data/actions/scripts/dzwignia.lua:4>

the lever opens the stone but after pressing it again does not close the stone so the senselessness after leaving in tp and after entering it is still impossible to move the lever
Can you show a screenshot of the area in-game, Before and After stone is removed?
 
Because I do not have a mistake, it is only after

the error appears when I press the lever twice

[C]: in function 'doCreateItem'
data/actions/scripts/dzwignia.lua:8: in function <data/actions/scripts/dzwignia.lua:4>
 
Because I do not have a mistake, it is only after

the error appears when I press the lever twice

[C]: in function 'doCreateItem'
data/actions/scripts/dzwignia.lua:8: in function <data/actions/scripts/dzwignia.lua:4>
Yup. You showed me that error already.
Can you show a screenshot of the area in-game, Before and After stone is removed?
Can you show a screenshot of the area in-game, Before and After stone is removed?
 
8cbbe8fbe9fcd.jpg
8cbbe8fbe9fcd.jpg.html
 
We did not understand each other.

the script works for me.

only if the stone is opened after opening it can not be closed so if the player "A" opens the stone, then 10h later the player "B" enters the stone is still open
 
We did not understand each other.

the script works for me.

only if the stone is opened after opening it can not be closed so if the player "A" opens the stone, then 10h later the player "B" enters the stone is still open
I can help with that, but only if my original script works.

The way you've explain it thus far..

Use switch
-> Stone removes.
Use switch again
-> Error

and as far as I can tell, there should be no error.
-----

This is the way it shows in source how to use this function.
LUA:
doCreateItem(itemid, type/count, pos)

In my code this line..
LUA:
doCreateItem(stoneID, 1, stonePosition)
Is essentially this..
LUA:
doCreateItem(1355, 1, {x = 193, y = 161, z = 10})

So unless you can find out how this function works in your server.. I don't know how to help further.
 
Back
Top