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

Error scripting

Lontra

New Member
Joined
Jul 11, 2016
Messages
3
Reaction score
0
The script is : I put a gold coin in the conter and press the lever, then the wall disappear.
Well... the problem is in line 10
Code:
and getpiece1.itemid == 9485 and getpiece4.itemid == 2148
When i start the server, isn't working, but, when i remove the part of line 10 do /reload action , put new walls and put the part of line 10 again it Works perfectly...
WHY?

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
piece1pos = {x=2022, y=2073, z=8, stackpos=1}
piece2pos = {x=2023, y=2073, z=8, stackpos=1}
piece3pos = {x=2024, y=2073, z=8, stackpos=1}
piece4pos = {x=2026, y=2073, z=8, stackpos=255} -- gold
getpiece1 = getThingfromPos(piece1pos)
getpiece2 = getThingfromPos(piece2pos)
getpiece3 = getThingfromPos(piece3pos)
getpiece4 = getThingfromPos(piece4pos)
if item.uid == 30005 and item.itemid == 9531 and getpiece1.itemid == 9485 and getpiece4.itemid == 2148 then
doRemoveItem(getpiece1.uid,1)
doRemoveItem(getpiece2.uid,1)
doRemoveItem(getpiece3.uid,1)
doRemoveItem(getpiece4.uid,1)
doPlayerSendTextMessage(cid,22,"Oh it's open!")
addEvent(doCreateItem, 1*10*1000, 9485, piece1pos)
addEvent(doCreateItem, 1*10*1000, 9485, piece2pos)
addEvent(doCreateItem, 1*10*1000, 9485, piece3pos)
else
doPlayerSendTextMessage(cid,22,"You can't do this now.")
end
return 1
end

517sj9.jpg
 
Back
Top