Can anyone help me, i need a addon lever script, when you have x item and use a lever, you get both addons(first + second) for only 1 outfit.. example: Hunter
Solved:
Credits and thanks to Ninja
Solved:
Code:
local t = {
--[ACTIONID] = {FEMALEID, MALEID, "OUTFITNAME"}
[8001] = {136, 128, "citizen"},
[8002] = {137, 129, "hunter"},
[8003] = {138, 130, "mage"},
[8004] = {139, 131, "knight"},
[8005] = {140, 132, "nobleman"},
[8006] = {141, 133, "summoner"},
[8007] = {142, 134, "warrior"},
[8008] = {147, 143, "barbarian"},
[8009] = {148, 144, "druid"},
[8010] = {149, 145, "wizard"},
[8011] = {150, 146, "oriental"},
[8012] = {155, 151, "pirate"},
[8013] = {156, 152, "assassin"},
[8014] = {157, 153, "beggar"},
[8015] = {158, 154, "shaman"},
[8016] = {252, 251, "norseman"},
[8017] = {269, 268, "nightmare"},
[8018] = {270, 273, "jester"},
[8019] = {279, 278, "brotherhood"},
[8020] = {288, 289, "demonhunter"},
[8021] = {324, 325, "yalaharian"},
[8022] = {336, 335, "warmaster"},
[8023] = {136, 128, "wayfarer"}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[item.actionid]
local k = getPlayerSex(cid) == 0 and v[1] or v[2]
local msg = {"You\'ve already obtained the "..v[3].." addons!", "You don't have any addon doll.", "Congratulations, you\'ve obtained the "..v[3].." addons!"}
if canPlayerWearOutfit(cid, k, 3) then
return doPlayerSendCancel(cid, msg[1]), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF), false
end
if getPlayerItemCount(cid, 6567) < 1 then
return doPlayerSendCancel(cid, msg[2]), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF), false
end
doPlayerAddOutfit(cid, k, 3)
doPlayerRemoveItem(cid, 6567, 1)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[3])
return true
end
Credits and thanks to Ninja
Last edited: