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

TFS [0.3.6] Target only worn items

zDeluxe

Member
Joined
Sep 29, 2012
Messages
18
Reaction score
11
Is anyone aware of how I can make the following script only apply to the item (Starlight amulet) that is being worn? Currently, it will remove items from the players bag as well, and I only intend for this script to activate if someone is wearing an SL. Thank you!

Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
     if skill == SKILL__LEVEL and newlevel >  50000 then
    doPlayerRemoveItem(cid, 2138,1)
    doPlayerSendTextMessage(cid,22, '!! ******WARNING****** !!')
    doPlayerSendTextMessage(cid,18, '!!-- You are now over 50K Lv, your SL Has been REMOVED please buy a Protector -- !!')
        return false
    end
    return true
end
 
Solution
Is anyone aware of how I can make the following script only apply to the item (Starlight amulet) that is being worn? Currently, it will remove items from the players bag as well, and I only intend for this script to activate if someone is wearing an SL. Thank you!

Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
     if skill == SKILL__LEVEL and newlevel >  50000 then
    doPlayerRemoveItem(cid, 2138,1)
    doPlayerSendTextMessage(cid,22, '!! ******WARNING****** !!')
    doPlayerSendTextMessage(cid,18, '!!-- You are now over 50K Lv, your SL Has been REMOVED please buy a Protector -- !!')
        return false
    end
    return true
end
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL...
Is anyone aware of how I can make the following script only apply to the item (Starlight amulet) that is being worn? Currently, it will remove items from the players bag as well, and I only intend for this script to activate if someone is wearing an SL. Thank you!

Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
     if skill == SKILL__LEVEL and newlevel >  50000 then
    doPlayerRemoveItem(cid, 2138,1)
    doPlayerSendTextMessage(cid,22, '!! ******WARNING****** !!')
    doPlayerSendTextMessage(cid,18, '!!-- You are now over 50K Lv, your SL Has been REMOVED please buy a Protector -- !!')
        return false
    end
    return true
end
not tested:

Lua:
local amuletId = 2138
function onAdvance(cid, skill, oldlevel, newlevel)
  if skill == SKILL__LEVEL and newlevel >  50000 then
    local equipped = getPlayerSlotItem(cid,CONST_SLOT_NECKLACE)
    if equipped and equipped.itemid == amuletId then
      doRemoveItem(equipped.uid)
      doPlayerSendTextMessage(cid,22, '!! ******WARNING****** !!')
      doPlayerSendTextMessage(cid,18, '!!-- You are now over 50K Lv, your SL Has been REMOVED please buy a Protector -- !!')
      return false
    end
  end
 return true
end
 
Is anyone aware of how I can make the following script only apply to the item (Starlight amulet) that is being worn? Currently, it will remove items from the players bag as well, and I only intend for this script to activate if someone is wearing an SL. Thank you!

Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
     if skill == SKILL__LEVEL and newlevel >  50000 then
    doPlayerRemoveItem(cid, 2138,1)
    doPlayerSendTextMessage(cid,22, '!! ******WARNING****** !!')
    doPlayerSendTextMessage(cid,18, '!!-- You are now over 50K Lv, your SL Has been REMOVED please buy a Protector -- !!')
        return false
    end
    return true
end

Is there a reason of using tfs 0.3.6? Im just curious :D
 
Is anyone aware of how I can make the following script only apply to the item (Starlight amulet) that is being worn? Currently, it will remove items from the players bag as well, and I only intend for this script to activate if someone is wearing an SL. Thank you!

Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
     if skill == SKILL__LEVEL and newlevel >  50000 then
    doPlayerRemoveItem(cid, 2138,1)
    doPlayerSendTextMessage(cid,22, '!! ******WARNING****** !!')
    doPlayerSendTextMessage(cid,18, '!!-- You are now over 50K Lv, your SL Has been REMOVED please buy a Protector -- !!')
        return false
    end
    return true
end
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL and newlevel > 50000 then
        local amuletId = 2138
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amuletId then
            doPlayerRemoveItem(cid, amuletId, 1)
            doPlayerSendTextMessage(cid, 22, '!! ******WARNING****** !!')
            doPlayerSendTextMessage(cid, 18, '!!-- You are now over 50K Lv, your SL has been REMOVED. Please buy a Protector -- !!')
            return false
        end
    end
    return true
end
 
Solution
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL and newlevel > 50000 then
        local amuletId = 2138
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amuletId then
            doPlayerRemoveItem(cid, amuletId, 1)
            doPlayerSendTextMessage(cid, 22, '!! ******WARNING****** !!')
            doPlayerSendTextMessage(cid, 18, '!!-- You are now over 50K Lv, your SL has been REMOVED. Please buy a Protector -- !!')
            return false
        end
    end
    return true
end
Thank you, this worked :)
Post automatically merged:

Is there a reason of using tfs 0.3.6? Im just curious :D
I host a 7.6 server!
 
Back
Top