Postado Abril 1, 2022 3 anos 5 minutos atrás, raphadoidera disse: Colocando dessa forma, não iria possibilitar apenas a vocação 1 e 13 de usarem? Ao invés de possibilitar da vocação 1 até a vocação 13? pra ser da 1 até a 13 coloca assim if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 13 then ..código.. end ai ele checa se a vocação é maior ou igual a 1 e menos igual 13, ou seja tudo entre 1 e 13 ele pega 7 minutos atrás, raphadoidera disse: if getPlayerVocation(cid) == 1 or if getPlayerVocation(cid) == 13 me equivoquei nessa parte ali esse "or if" não tem, só "or get..", usa oq te passei acima que vai funcionar . vou arrumar aqui o script pra vc local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 13 then if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end end return true end
Postado Abril 1, 2022 3 anos Autor 5 minutos atrás, FeeTads disse: pra ser da 1 até a 13 coloca assim if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 13 then ..código.. end ai ele checa se a vocação é maior ou igual a 1 e menos igual 13, ou seja tudo entre 1 e 13 ele pega me equivoquei nessa parte ali esse "or if" não tem, só "or get..", usa oq te passei acima que vai funcionar Ainda ta dando esse erro na distro.
Postado Abril 1, 2022 3 anos 9 minutos atrás, raphadoidera disse: Ainda ta dando esse erro na distro. tenta assim. local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getPlayerVocation(cid) > 13 then return true end if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end return true end se continuar esse erro, procura por "getPlayerVocation" na sua source em luascript.cpp
Postado Abril 1, 2022 3 anos Autor 3 minutos atrás, FeeTads disse: tenta assim. local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getPlayerVocation(cid) > 13 then return true end if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end return true end se continuar esse erro, procura por "getPlayerVocation" na sua source em luascript.cpp Funcionou papai, só mais uma coisa mano (foi mal). Queria que você colocasse pra sair no chat "Sua vocação não pode usar este item." caso uma vocação diferente tente usar o item, por favor.
Postado Abril 1, 2022 3 anos Solução 3 minutos atrás, raphadoidera disse: Funcionou papai, só mais uma coisa mano (foi mal). Queria que você colocasse pra sair no chat "Sua vocação não pode usar este item." caso uma vocação diferente tente usar o item, por favor. local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getPlayerVocation(cid) > 13 then doPlayerSendTextMessage(cid, 22, "Sua vocação não pode usar este item!") return true end if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end return true end se funcionar deixa o rep+ ai pra ajudar
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.