Vc quer que o item seja removido após usar? Esse script não remove o item:
local config = {storage = 2016 -- storagelooktype_male = X, -- male.looktype_female = y, -- Yfemaleaddons = Z, }function onUse(cid, item, fromPosition, itemEx, toPosition)if getPlayerStorageValue(cid,config.storage) < 1 thenif getPlayerSex(cid) == 0 thendoPlayerAddOutfit(cid,config.looktype_female,config.addons)doPlayerSendTextMessage(cid,20,'You got an outfit.')doSendMagicEffect(getThingPos(cid),12)elseif getPlayerSex(cid) == 1 thendoPlayerAddOutfit(cid,config.looktype_male,config.addons)doPlayerSendTextMessage(cid,20,'You got an outfit.')doSendMagicEffect(getThingPos(cid),12)endelsedoPlayerSendTextMessage(cid,20,'You already have this outfit.')doSendMagicEffect(getThingPos(cid),2)endreturn trueend
(x: outfit pra male / y: outfit pra female / z: quantos addons vai entregar)
Já Este remove (créditos CodexNG)
local c = { male = 620, -- looktype of the outfit for male. female = 619, -- looktype of the outfit for female addons = 0, -- how many addons you get. storage = 5012, -- storage value used. removeAmount = 1}function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) local msg = '' if player:getStorageValue(c.storage) < 1 then player:addOutfitAddon(player:getSex() == 0 and c.male or c.female, c.addons) msg = 'You got an outfit.' item:remove(c.removeAmount) player:setStorageValue(c.storage, 1) else msg = 'You already have this outfit.' end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg) player:getPosition():sendMagicEffect(CONST_ME_ENERGYHIT) return trueend






info
Grupo: Cavaleiro
Registrado: 22/07/16
Posts: 189
Reputação: +27
Gênero: Masculino
Queria Que Quando o Player desce use em um item ele ganharia tal outfit pra sempre