• 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 [Amulet] Bless, Noneskull, Whiteskull, Redkull and BlackSkull

FearWar

Active Member
Joined
Sep 17, 2017
Messages
221
Reaction score
26
Location
Brasil
Hi guys Otland,

I am using this code for my amulet,

Lua:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}
function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 12668 then
        doCreatureSetDropLoot(cid, false)
        doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected for amulet!")
        end
    end
    return true
    end

But he wanted it when the amulet was used, it would give automatic "bless" along with the amulet!

Please help-me!

Thanks Otland.
 
Hi guys Otland,

I am using this code for my amulet,

Lua:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}
function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 12668 then
        doCreatureSetDropLoot(cid, false)
        doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected for amulet!")
        end
    end
    return true
    end

But he wanted it when the amulet was used, it would give automatic "bless" along with the amulet!

Please help-me!

Thanks Otland.

Not sure what you mean with "when used"
But you can add this below doItemSetAttribute...
Lua:
for i = 1, 5 do
    doPlayerAddBlessing(cid, i)
end
 
Not sure what you mean with "when used"
But you can add this below doItemSetAttribute...
Lua:
for i = 1, 5 do
    doPlayerAddBlessing(cid, i)
end

Look, 'ends'

Lua:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}
function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 12669 then
        doCreatureSetDropLoot(cid, false)
        doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected for amulet!")
    for i = 1, 5 do
    doPlayerAddBlessing(cid, i)
    end
        end
    end
    return true
    end

Ok?
 
Look, 'ends'

Lua:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}
function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 12669 then
        doCreatureSetDropLoot(cid, false)
        doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected for amulet!")
    for i = 1, 5 do
    doPlayerAddBlessing(cid, i)
    end
        end
    end
    return true
    end

Ok?

Always tab your code, it will make it easier to find faults.
Looks fine to me;
Lua:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}

function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 12669 then
            doCreatureSetDropLoot(cid, false)
            doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected for amulet!")
            for i = 1, 5 do
                doPlayerAddBlessing(cid, i)
            end
        end
    end

    return true
end

What you could do is replace < 6 "6" with the correct constant value (ex SKULL_WHITE or w/e it is)
 
Always tab your code, it will make it easier to find faults.
Looks fine to me;
Lua:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}

function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 12669 then
            doCreatureSetDropLoot(cid, false)
            doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected for amulet!")
            for i = 1, 5 do
                doPlayerAddBlessing(cid, i)
            end
        end
    end

    return true
end

What you could do is replace < 6 "6" with the correct constant value (ex SKULL_WHITE or w/e it is)
Not work
Imgur: The most awesome images on the Internet



IXLP3LI
 

Similar threads

Back
Top