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

doCreateItem when pushing a lever?

apockalyptik

New Member
Joined
Jun 17, 2007
Messages
47
Reaction score
0
Hi

I'm checking if one POI script I have works with TFS and things were working just fine but I got stuck in one part:

I wanna make so that when you push this switch:
09:15 You see a switch.
ItemID: [1945].
UniqueID: [1818].
Position: [X: 419] [Y: 426] [Z: 9].

some kind of bridge, apear in this place:
09:17 You see dirt.
ItemID: [4808].
Position: [X: 418] [Y: 419] [Z: 9].

So players can keep going on, they need that bridge to appear or they cant pass.

The .lua script:

Code:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=418, y=419, z=9, stackpos=1}
getgate = getThingfromPos(gatepos)

if item.uid == 1818 and item.itemid == 1945 and getgate.itemid == 0 then
doCreateItem(1284,1,gatepos)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 1818 and item.itemid == 1946 and getgate.itemid == 1284 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
  return 1
  end

And I added to the actions.xml
Code:
<action uniqueid="1818" script="testebridge.lua" />

The problem is when I try to push the switch, it says "Sorry not possible" and nothing happens.

I'm using the latest FTS
 
Back
Top