Facebook
From Tomten, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 62
  1. ```local config = {
  2.         effect = 12,
  3.  
  4.         validTiles = {
  5.                 100,101,103,104,106,108,109,919,1071,231,280,351,352,354,355,368,405,406,
  6.                 407,412,413,414,415,416,417,419,420,421,422,424,425,426,431,446,447,448,
  7.                 449,450,451,452,453,454,455,456,457,458,459,460,471,471,473,474,709,710,711,
  8.                 493,598,670,671,708,724,777,790,791,804,806,4832,4833,836,918,920,926,
  9.                 927,929,936,937,946,947,948,956,957,958,965,966,1284,1509,194,6210,6213,
  10.                 4595,4608,4609,4610,4611,4612,4613,4614,4515,4616,4691,4692,4693,4694,
  11.                 4695,3263,3264,3265,6389,5770,5769,5768,3152,3153,3154,3155,3156,3157,
  12.                 3169,3170,3171,3172,3177,3196,3200,3201,3202,3215,3216,3217,7062,7063,
  13.                 7064,7065,7066,3139,7272,7348,7350,7351,7352,7353,7354,7355,7356,7357,
  14.                 7358,6838,6967,4526,4530,4532,4535,4566,4570,4571,4572,9021,9022,9023,
  15.                 9024,9025,9043,9044,9045,9046,9047,9048,9049,9050,9059,9067,9068,9069,
  16.                 9070,9071,9072,8326,8327,8328,8329,8423,8425,8426,8427,8428,8429,8430,
  17.                 8431,8424,8578,8591,8594,8597,8598,9192,9193,9194,9195,9199,9224,9225,
  18.                 9226,9227,9228,9229,9230,9231,9232,9146,9272,9673,9883,9144
  19.         }
  20. }
  21.  
  22. function onSay(cid, words, param, channel)
  23.  
  24.         if(param == '') then
  25.                 doPlayerSendCancel(cid, "Parameter required (tile id)")
  26.                 return true
  27.         end
  28.  
  29.         if not tonumber(param) then
  30.                 doPlayerSendCancel(cid, "Invalid parameter:" .. tostring(param))
  31.                 return true
  32.         elseif(not isInArray(config.validTiles, tonumber(param))) then
  33.                 doPlayerSendCancel(cid, "Tile with ID: " .. tostring(param) .. " has not been configured.")
  34.                 return true
  35.         end
  36.  
  37.         local pos = getCreaturePosition(cid)
  38.         local startPos = {x=pos.x-1, y=pos.y-1, z=pos.z} -- top left (dont change)
  39.         local endPos = {x=pos.x+1, y=pos.y+1, z=pos.z} -- bottom right (dont change)
  40.  
  41.  
  42.         for i = startPos.y, endPos.y, 1 do
  43.                 for j = startPos.x, endPos.x, 1 do
  44.                         doTransformItem(getTileInfo({x=j, y=i, z=pos.z}).uid, tonumber(param))
  45.                         doSendMagicEffect(pos, config.effect)
  46.                 end
  47.         end
  48.  
  49.         return true
  50. end```