View difference between Paste ID: 9Yv9uxRt and MamTpSbA
SHOW: | | - or go back to the newest paste.
1
local slots = 10 -- Para registro, nao mexa
2
local tabVal = {
3
    [2523] = {value = 1, slot = 0}, -- O Numero do Slot
4
    [2195] = {value = 2, slot = 1}
5
}
6
 
7
function onEquip(cid, item, slot)
8
local soma = 0
9
    for x = 1, 10 do
10
        checkItem = tabVal[getPlayerSlotItem(cid, x).itemid]
11
        if checkItem and slot == checkItem.slot then
12
            soma = soma + checkItem.value
13
        end
14
        if x == slots then
15
            getColor = getCreatureOutfit(cid)
16
            result = {lookType = 128, lookHead = getColor.lookHead, lookBody = getColor.lookBody, lookLegs = getColor.lookLegs, lookFeet = getColor.lookFeet, lookAddons = soma}
17
            doSetCreatureOutfit(cid, result, -1)
18
        end
19
    end
20
return true
21
end
22
23
function onDeEquip(cid, item, slot)
24
local soma = 0
25
    for x = 1, 10 do
26
        checkItem = tabVal[getPlayerSlotItem(cid, x).itemid]
27
        if checkItem and slot == checkItem.slot then
28
            soma = soma + checkItem.value
29
        end
30
        if x == slots then
31
            getColor = getCreatureOutfit(cid)
32
            result = {lookType = 128, lookHead = getColor.lookHead, lookBody = getColor.lookBody, lookLegs = getColor.lookLegs, lookFeet = getColor.lookFeet, lookAddons = soma}
33
            doSetCreatureOutfit(cid, result, -1)
34
        end
35
    end
36
return true
37
end