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

Lua action script

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
Hello otlanders i reieve this error can someone please fx the script ? ;)
PHP:
[11:2:23.262] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/itemstoitems/5hstamina.lua)
[11:2:23.262] data/actions/scripts/itemstoitems/5hstamina.lua:23: unexpected symbol near 'then'

script
PHP:
local cfg = {
   coal_basin_pos = {x = 987, y = 990, z = 4, stackpos = 2},
   require_item = {6527, 50},
   give_item = 7447
}
  
function onUse(cid, item, fromPosition, itemEx, toPosition)

   tilePos = {x = 987, y = 991, z = 4}
   standPos = getCreaturePosition(cid)
   if (standPos.x ~= tilePos.x or standPos.y ~= tilePos.y or standPos.z ~= tilePos.z) then
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     doPlayerAddSoul(cid, -5)
     if getCreatureHealth(cid) > 500 then
       doCreatureAddHealth(cid, -500)
     else
       doCreatureAddHealth(cid, -(getCreatureHealth(cid) - 1))
     end
     return doPlayerSendCancel(cid, "I require your feet on good position!.")
   end
  
   if getPlayerSoul(cid) >= 20 then
     if getTileItemById(cfg.coal_basin_pos, cfg.require_item[1]).type > cfg.require_item[2] and then
       doPlayerAddSoul(cid, -20)
       doRemoveItem(getTileItemById(cfg.coal_basin_pos, cfg.require_item[1]).uid, cfg.require_item[2])
       doCreateItem(cfg.give_item, 1, cfg.coal_basin_pos)
       doCreatureSay(cid, "Magical Transformation!", TALKTYPE_ORANGE_1, false, 0, cfg.coal_basin_pos)
       doCreatureSay(cid, "There you go your stamina ice statue!", TALKTYPE_ORANGE_1, false, 0, cfg.coal_basin_pos)
       doSendMagicEffect(cfg.coal_basin_pos, CONST_ME_FIREWORK_RED)
     else
       return doPlayerSendCancel(cid, "Where my items? :(... No seriously. Items or die.  plz")
     end
   else
     return doPlayerSendCancel(cid, "I require soul to transform items.")
   end
  
   return true
end


Thanks in advance
 
Code:
if getTileItemById(cfg.coal_basin_pos, cfg.require_item[1]).type > cfg.require_item[2] and then

for

Code:
if getTileItemById(cfg.coal_basin_pos, cfg.require_item[1]).type > cfg.require_item[2] then
 
Code:
if getTileItemById(cfg.coal_basin_pos, cfg.require_item[1]).type > cfg.require_item[2] and then

for

Code:
if getTileItemById(cfg.coal_basin_pos, cfg.require_item[1]).type > cfg.require_item[2] then
works thanks,

but why i have to put 51 item not 50 as i set so script works , if i put 50 on coal basin its says put item if i put more than 50 it removes 50 and adds item, srange :D
 
works thanks,

but why i have to put 51 item not 50 as i set so script works , if i put 50 on coal basin its says put item if i put more than 50 it removes 50 and adds item, srange :D
Code:
if getTileItemById(cfg.coal_basin_pos, cfg.require_item[1]).type >= cfg.require_item[2] then
 
Back
Top