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

Converting 0.3.6 > 0.2.15

survivor

New Member
Joined
Mar 20, 2008
Messages
89
Reaction score
4
Hello,

Could anyone please make this script work for 0.2.15?

Code:
local positions = {
{x=1498, y=863, z=5, stackpos=1},
}
local wallid = 1546
local wall = {} -- should be a table
local time_ = 10

local function doCreateWalls()
  for x = 1, #positions do
  doCreateItem(wallid, 1, positions[x])
  wall[x] = nil -- delete the table
  end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
  if #wall < #positions then -- is the wall table empty
  for x = 1, #positions do
  wall[x] = getTileItemById(positions[x], wallid).uid
  doRemoveItem(wall[x], 1)
  end
  addEvent(doCreateWalls, time_ * 1000)
  doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
  return true
  else
  doPlayerSendCancel(cid, "The walls are already removed.")
  return false
  end
end

yours,
 
oke thanks, thought every script had to be changed phew..

how about "DoCreateMonster"?
tried to spice the script up a bit but on 0.2 it doesn't seem to work ;/

cuz this one worked at 0.3 but now it says: "attempt to call global 'DoCreateMonster' (a nil value)

Code:
local positions = {
{x=1314, y=1131, z=7, stackpos=1},
{x=1314, y=1132, z=7, stackpos=1},
{x=1314, y=1133, z=7, stackpos=1},
{x=1314, y=1131, z=6, stackpos=1},
{x=1314, y=1132, z=6, stackpos=1},
{x=1314, y=1133, z=6, stackpos=1},
}
local wallid = 3519
local wall = {} -- should be a table
local time_ = 1800

local function doCreateWalls()
  for x = 1, #positions do
  doCreateItem(wallid, 1, positions[x])
  wall[x] = nil -- delete the table
  end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
  if #wall < #positions then -- is the wall table empty
       doCreatureSay(cid, "You have alarmed the orcs!", TALKTYPE_ORANGE_1)
       doCreateMonster('orc', {x=1289, y =1131, z=7})
       doCreateMonster('orc spearman', {x=1293, y=1131, z=7})
       doCreateMonster('orc',{x=1298, y =1131, z =7})
       doCreateMonster('orc spearman', {x=1305, y=1131, z=7})
       doCreateMonster('orc', {x=1313, y=1131, z=7})
       doCreateMonster('orc', {x=1307, y=1124, z=7})
  for x = 1, #positions do
  wall[x] = getTileItemById(positions[x], wallid).uid
  doRemoveItem(wall[x], 1)
  end
  addEvent(doCreateWalls, time_ * 1000)
  doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
  return true
  else
  doPlayerSendCancel(cid, "The gate is already opened.")
  return false
  end
end
 
Back
Top