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

Getting this error on charges.lua & npc don't respone

RockeTBunnYz

Trainee in progress
Joined
Jan 21, 2015
Messages
137
Reaction score
7
Location
sweden
[0:23:18.334] [Error - LuaInterface::loadFile] data/creaturescripts/scripts/char
ges.lua:3: ')' expected near 'then'
[0:23:18.335] [Warning - Event::loadScript] Cannot load script (data/creaturescr
ipts/scripts/charges.lua)
[0:23:18.336] data/creaturescripts/scripts/charges.lua:3: ')' expected near 'the
n'



Code:
 function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
  local amulet = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE)
        if ((getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2138)     then
            doChangeTypeItem(amulet.uid, amulet.type+1)       then
                doSendMagicEffect(getCreaturePosition(cid), 39)
     end
    return true
    end

and i have another problem too the npc wont respone to hi, hey, hello

Thanks you for helping me!
 
Last edited:
Edit: removed unneeded parentheses
Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local amulet = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE)
    if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2138 then
        doChangeTypeItem(amulet.uid, amulet.type+1)
        doSendMagicEffect(getCreaturePosition(cid), 39)
    end
    return true
end
 
Edit: removed unneeded parentheses
Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local amulet = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE)
    if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2138 then
        doChangeTypeItem(amulet.uid, amulet.type+1)
        doSendMagicEffect(getCreaturePosition(cid), 39)
    end
    return true
end

thanks you
 
Back
Top Bottom