What is this script for having an NPC sell oufits and addons? i would like them separately like as in you have to purchase each addon by iteself as well as any additional besides start premium addons. I have no clue how to do this so anything helps!
try this, its actions script.What is this script for having an NPC sell oufits and addons? i would like them separately like as in you have to purchase each addon by iteself as well as any additional besides start premium addons. I have no clue how to do this so anything helps!
local t = {
[3000] = {
male = 128,
female = 136,
name = 'citizen',
items = {
{5911, 5}, {2661, 1}, {2160, 2} -- 5 red pieces of cloth, 1 scarf, 50k
}
},
[3001] = {
male = 129,
female = 137,
name = 'hunter',
items = {
{5879,5}, {5911,10} -- 5 gs silk, 10 red poc
}
},
[3002] = {
male = 130,
female = 138,
name = 'mage',
items = {
{2162, 1}, {2149, 100} -- 1 magic lightwands, 100 small emeralds
}
},
[3003] = {
male = 131,
female = 139,
name = 'knight',
items = {
{2400, 1}, {2136, 1} -- 1 magic swords, a demonbone amulet
}
},
[3004] = {
male = 132,
female = 140,
name = 'nobleman',
items = {
{2160, 25} -- 25cc
}
},
[3005] = {
male = 133,
female = 141,
name = 'summoner',
items = {
{2162, 1}, {2149, 100} -- 1 magic lightwands, 100 small emeralds
}
},
[3006] = {
male = 134,
female = 142,
name = 'warrior',
items = {
{5925, 5}, {8309, 5} -- 5 nails, 5 hardened bones
}
},
[3007] = {
male = 143,
female = 147,
name = 'barbarian',
items = {
{5911, 5}, {5913, 5}, {5879, 5}, {2431,1} -- 5 brown pieces of cloth, 5 red pieces of cloth, 5 giant spider silks and a stonecutter axe
}
},
[3008] = {
male = 144,
female = 148,
name = 'druid',
items = {
{5896, 10}, {5897, 10} -- 10 wolf paws and 10 bear paws
}
},
[3009] = {
male = 145,
female = 149,
name = 'wizard',
items = {
{2229, 5}, {2804, 1}, {2160, 50} --- 5 skulls, 1 shadow herbs and 50cc
}
},
[3010] = {
male = 146,
female = 150,
name = 'oriental',
items = {
{12466, 1}, {10568, 1} --- scroll of heroic deeds, scorpion tale
}
},
[3011] = {
male = 151,
female = 155,
name = 'pirate',
items = {
{6126, 15}, {6098, 15}, {6097, 15} --- 15 peg legs, 15 eye patches and 15 hooks
}
},
[3012] = {
male = 152,
female = 156,
name = 'assassin',
items = {
{5911, 10}, {5913, 10}, {5906, 10}, {5882, 10} --- 10 brown pieces of cloth, 10 red pieces of cloth, 10 demon dusts and 10 red dragon scales
}
},
[3013] = {
male = 153,
female = 157,
name = 'beggar',
items = {
{10021, 1}, {2651, 1} --- worn soft boots and 1 coat
}
},
[3014] = {
male = 154,
female = 158,
name = 'shaman',
items = {
{3970, 1}, {12495, 5} --- 1 feather headdresses and 5 goblin ears
}
},
[3015] = {
male = 273,
female = 270,
name = 'jester',
items = {
{5911, 100}, {xxxx, 1}
}
},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[item.uid]
if v then
local c = getPlayerSex(cid) == 0 and v.female or v.male
if not canPlayerWearOutfit(cid, c, 3) then
for _, i in ipairs(v.items) do
if getPlayerItemCount(cid, i[1]) < i[2] then
doPlayerSendCancel(cid, 'Sorry, you don\'t have all neccessary items to obtain these addons!')
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return true
end
end
for i = 1, #v.items do
doPlayerRemoveItem(cid, v.items[i][1], v.items[i][2])
end
doPlayerAddOutfit(cid, c, 3)
doCreatureSay(cid, 'Congratulations, you have obtained ' .. v.name .. ' addons!', TALKTYPE_ORANGE_1)
local x = getCreatureOutfit(cid)
x.lookType,x.lookAddons = c,3
doCreatureChangeOutfit(cid, x)
doSendMagicEffect(getThingPos(cid), math.random(28, 30))
else
doPlayerSendCancel(cid, 'You already have ' .. v.name .. ' addons!')
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
return true
end
end
nvm use this...so these are for both addons together correct? how would i do them separately
?