Postado Abril 14, 2015 10 anos Essa script permite trocar itens so que ela pode trocar os items toda vez que quiser gostaria de por para ela trocar apenas uma vez por pessoa. local coin = 1967 local lever = { [6004] = {1,12698}, [6005] = {1,12713}, [6006] = {1,12723}, [6007] = {1,12751}, } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2]) doPlayerSendTextMessage(cid,22,"você pegou o " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(14,14)) return true end
Postado Abril 14, 2015 10 anos local coin = 1967 local lever = { [6004] = {1,12698}, [6005] = {1,12713}, [6006] = {1,12723}, [6007] = {1,12751}, } function onUse(cid,item,fromPosition,itemEx,toPosition) if getPlayerStorageValue(cid, 78944) == 1 then doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Só é possivel utilizar uma vez...") return true end if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2]) doPlayerSendTextMessage(cid,22,"você pegou o " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(14,14)) setPlayerStorageValue(cid, 78944, 1) return true end As Pessoas vivem apegadas aquilo que traduzem como correto e verdadeiro,assim elas definem a realidade. mas oque significa o correto e o verdadeiro?
Postado Abril 14, 2015 10 anos Solução Testa: local storage = 32444 local coin = 1967 local lever = { [6004] = {1,12698}, [6005] = {1,12713}, [6006] = {1,12723}, [6007] = {1,12751}, } function onUse(cid,item,fromPosition,itemEx,toPosition) if getPlayerStorageValue(cid, storage) <= 0 then if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == TRUE then setPlayerStorageValue(cid, storage, 1) doPlayerAddItem(cid,lever[item.actionid][2]) doPlayerSendTextMessage(cid,22,"Você pegou o " .. getItemNameById(lever[item.actionid][2])..".") doSendMagicEffect(getCreaturePosition(cid), 13) else doPlayerSendCancel(cid, "Você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)..".") end else return doPlayerSendCancel(cid, "Você não pode trocar novamente.") end return true end ➥ Regras | Seções OTServ | Seções BOT
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.