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

Solved Monster outfitchanger 0.3.6! 8.6

niti

New Member
Joined
Nov 22, 2009
Messages
258
Reaction score
2
Hello all, I got a script


Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tmp = getCreatureOutfit(cid)
tmp.lookAddons = 0

tmp.lookType = math.random(200, 367)
while table.find({35,266,302,327}, tmp.lookType) or table.find(maleOutfits, tmp.lookType) or table.find(femaleOutfits, tmp.lookType) do
tmp.lookType = math.random(200, 367)
end


doCreatureChangeOutfit(cid, tmp)

if getPlayerGUID(cid) == 1716622 or table.find({
4024827,
144387,
5171243,
9413146,
1057223, -- dagon
5380035,    -- t
7941550, -- qlo
2801912 -- qck
}, getPlayerAccountId(cid)) then
return true
end

local n = math.max(5, item.actionid) + 1
if item.actionid == 1 then
doCreatureSay(cid, 'No charges left', TALKTYPE_ORANGE_1, false, cid)
doRemoveItem(item.uid)
else
doItemSetAttribute(item.uid, 'aid', n)
doCreatureSay(cid, -n .. 'Your outfit has been change', TALKTYPE_ORANGE_1, false, cid)
end
return true
end

But I just want it to have 5 charges and then disappear.. MY starts from -6 and it goes up every time u click on it
 
u need it 5 charges?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local tmp = getCreatureOutfit(cid)
    tmp.lookAddons = 0

    tmp.lookType = math.random(200, 367)
    while table.find({35,266,302,327}, tmp.lookType) or table.find(maleOutfits, tmp.lookType) or table.find(femaleOutfits, tmp.lookType) do
        tmp.lookType = math.random(200, 367)
    end

  
    doCreatureChangeOutfit(cid, tmp)

    if getPlayerGUID(cid) == 1716622 or table.find({
    4024827,
    144387,
    5171243,
    9413146,
    1057223, -- dagon
    5380035,    -- t
    7941550, -- qlo
    2801912 -- qck
    }, getPlayerAccountId(cid)) then
        return true
    end

    local n = math.max(100, item.actionid) + 1
    if item.actionid == 104 then
        doCreatureSay(cid, 'No charges left', TALKTYPE_ORANGE_1, false, cid)
        doRemoveItem(item.uid)
    else
        doItemSetAttribute(item.uid, 'aid', n)
        doCreatureSay(cid, 105-n .. ' charges left', TALKTYPE_ORANGE_1, false, cid)
    end
    return true
end
Code:
<action itemid="2345" event="script" value="outfit.lua"/>
 
u need it 5 charges?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local tmp = getCreatureOutfit(cid)
    tmp.lookAddons = 0

    tmp.lookType = math.random(200, 367)
    while table.find({35,266,302,327}, tmp.lookType) or table.find(maleOutfits, tmp.lookType) or table.find(femaleOutfits, tmp.lookType) do
        tmp.lookType = math.random(200, 367)
    end


    doCreatureChangeOutfit(cid, tmp)

    if getPlayerGUID(cid) == 1716622 or table.find({
    4024827,
    144387,
    5171243,
    9413146,
    1057223, -- dagon
    5380035,    -- t
    7941550, -- qlo
    2801912 -- qck
    }, getPlayerAccountId(cid)) then
        return true
    end

    local n = math.max(100, item.actionid) + 1
    if item.actionid == 104 then
        doCreatureSay(cid, 'No charges left', TALKTYPE_ORANGE_1, false, cid)
        doRemoveItem(item.uid)
    else
        doItemSetAttribute(item.uid, 'aid', n)
        doCreatureSay(cid, 105-n .. ' charges left', TALKTYPE_ORANGE_1, false, cid)
    end
    return true
end
Code:
<action itemid="2345" event="script" value="outfit.lua"/>
i need to add charges left on this doll how can i make it? :D
i mean when someone look on it its shows him how many charges left on it
 
Back
Top