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

Change Script 0.4 to 1.2

115820

Member
Joined
Feb 27, 2011
Messages
193
Solutions
1
Reaction score
5
Location
London, England
Hi everyone. I need help to change this script 0.4 to 1.2.]
Code:
function onUse (cid, item, fromPosition, itemEx, toPosition)

   -- SFNormal

   if(itemEx.itemid == 2346) and math.random(1,100) >= 15 then
    doSendAnimatedText(toPosition,"ENERGIZED",TEXTCOLOR_LIGHTBLUE)
                  doSendMagicEffect(getPlayerPosition(cid), 52)
   doPlayerRemoveItem(cid, 7760, 1)
    doTransformItem(itemEx.uid, 2349)
   elseif (itemEx.itemid ~= 2346) then
    doPlayerSendCancel(cid, "item inválido")
   elseif math.random(1,100) < 15 then
    doSendAnimatedText(toPosition,"Fail!",TEXTCOLOR_DARKPINK)
   doPlayerRemoveItem(cid, 7760, 1)

return true
   end

UP!
 
Last edited by a moderator:
@thexamx I Have error:
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/test.lua:onUse
data/global.lua:196: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
        [C]: at 0x7ff771950b00
        [C]: in function 'pairs'
        data/global.lua:196: in function 'isInArray'
        data/actions/scripts/test.lua:11: in function <data/actions/scripts/test.lua:8>
 
Last edited:
Back
Top