Ir para conteúdo
  • Cadastre-se

(Resolvido)Comando ganhar outfit !


Ir para solução Resolvido por gabrielzika,

Posts Recomendados

Alguém pode fazer uma script que funcione assim :

 quando um player usa o comando !removerakatsuki ele ganha x outfit para uma vocaçao determinada, mas quando ele loga perde ela .

Link para o post
Compartilhar em outros sites

@leozincorsair Testa ai em vez de perder outfit so quando deslogar, eu coloquei um tempo pra perder ela

Pra usar e so falar /out sakura ou !out sakura ou /out sasukeou !out sasuke e assim vai...

local a = {
  --[Talkaction]	=	{outfit = OutfitID, effect = EffectID, cd = Cooldown_em_minutos, msg = "Mensagem_enviada_ao_usar"},
	["Sakura"] = {outfit = 302, effect = 29, cd = 60, msg = "Você ganhou temporariamente um outfit da Sakura!"},
	["Sasuke"] = {outfit = 302, effect = 29, cd = 60, msg = "Você ganhou temporariamente um outfit do Sasuke!"},
	["Naruto"] = {outfit = 302, effect = 29, cd = 60, msg = "Você ganhou temporariamente um outfit do Naruto!"},
}

function onSay(cid, words, param)
local b = a[string.lower(param)]
local out = getCreatureOutfit(cid)

	local function ckfox()
		doCreatureChangeOutfit(cid, out)
	return true
	end

doCreatureChangeOutfit(cid, b.outfit)
doSendMagicEffect(getThingPos(cid), b.effect)
addEvent(ckfox, b.cd*60*1000)
sendMsgToPlayer(cid, 27, b.msg)
return true
end
<talkaction words="/out;!out" event="script" value="Nome_do_arquivo.lua"/>

 

 

Ajudei? REP+

 

Meus Servers:

PokeUnwind Em Breve

Rust Tibia Fechado

 

Tópicos: 

[Tutorial] Adicionando Pokemons com icon system

[Solução] ElfBot não abre corpos

 

Projetos:

DigiTibia Fechado

Rust Tibia Fechado(temporariamente!)

Link para o post
Compartilhar em outros sites
4 horas atrás, Ckfox disse:

@leozincorsair Testa ai em vez de perder outfit so quando deslogar, eu coloquei um tempo pra perder ela

Pra usar e so falar /out sakura ou !out sakura ou /out sasukeou !out sasuke e assim vai...


local a = {
  --[Talkaction]	=	{outfit = OutfitID, effect = EffectID, cd = Cooldown_em_minutos, msg = "Mensagem_enviada_ao_usar"},
	["Sakura"] = {outfit = 302, effect = 29, cd = 60, msg = "Você ganhou temporariamente um outfit da Sakura!"},
	["Sasuke"] = {outfit = 302, effect = 29, cd = 60, msg = "Você ganhou temporariamente um outfit do Sasuke!"},
	["Naruto"] = {outfit = 302, effect = 29, cd = 60, msg = "Você ganhou temporariamente um outfit do Naruto!"},
}

function onSay(cid, words, param)
local b = a[string.lower(param)]
local out = getCreatureOutfit(cid)

	local function ckfox()
		doCreatureChangeOutfit(cid, out)
	return true
	end

doCreatureChangeOutfit(cid, b.outfit)
doSendMagicEffect(getThingPos(cid), b.effect)
addEvent(ckfox, b.cd*60*1000)
sendMsgToPlayer(cid, 27, b.msg)
return true
end

<talkaction words="/out;!out" event="script" value="Nome_do_arquivo.lua"/>

 

 

onde coloco pra um vocaçao ganhar , ali esta no geral ?

ex : id da vocaçao ..

 

Erro :

 

errou.png

Editado por leozincorsair (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@leozincorsair Colocou em minusculas o script ?

["sakura"] = {outfit = 300, effect = 29, cd = 60, vocation = 1, vname = "Sakura", msg = "Você ganhou temporariamente um outfit da Sakura!"},

Na parte onde esta escritro ["sakura"] precisa ser tudo em minuscula!

Adicionei a da vocaçã em vocation você coloca o id da vocação e em vname coloca o nome da vocação

 

local a = {
  --[Talkaction]	=	{outfit = OutfitID, effect = EffectID, cd = Cooldown_em_minutos, msg = "Mensagem_enviada_ao_usar"},
	["sakura"] = {outfit = 300, effect = 29, cd = 60, vocation = 1, vname = "Sakura", msg = "Você ganhou temporariamente um outfit da Sakura!"},
	["sasuke"] = {outfit = 301, effect = 29, cd = 60, vocation = 2, vname = "Sasuke", msg = "Você ganhou temporariamente um outfit do Sasuke!"},
	["naruto"] = {outfit = 302, effect = 29, cd = 60, vocation = 3, vname = "Naruto", msg = "Você ganhou temporariamente um outfit do Naruto!"},
}

function onSay(cid, words, param)
local out = getCreatureOutfit(cid)
	local function ckfox()
		doCreatureChangeOutfit(cid, out)
	return true
	end
local b = a[string.lower(param)]
if getPlayerVocation(cid) == b.vocation then
doCreatureChangeOutfit(cid, b.outfit)
doSendMagicEffect(getThingPos(cid), b.effect)
addEvent(ckfox, b.cd*60*1000)
sendMsgToPlayer(cid, 27, b.msg)
return true
end
sendMsgToPlayer(cid, 27, "Sua vocação é " .. getPlayerVocationName(cid) .." você precisa ser da vocação".. vname)
return true
end

 

Ajudei? REP+

 

Meus Servers:

PokeUnwind Em Breve

Rust Tibia Fechado

 

Tópicos: 

[Tutorial] Adicionando Pokemons com icon system

[Solução] ElfBot não abre corpos

 

Projetos:

DigiTibia Fechado

Rust Tibia Fechado(temporariamente!)

Link para o post
Compartilhar em outros sites

coloquei tudo minusculo e certo

e ainda deu esse erro !

Agora, leozincorsair disse:

coloquei tudo minusculo e certo

e ainda deu esse erro !

 

Sem título.png

Link para o post
Compartilhar em outros sites

@leozincorsair veja se é isso que você quer testei aqui e está 100%... se quiser que perca quando desloga , eu posso fazer tambem ^^ Abraço!

 

Neste Script quando o Player Digitar somente;

 

/out  -- o comando pode ser trocado na tag do .xml

 

abrirá uma janela com o nome de  todas as vocações que tem esse comando...

 

local vocs = {
[1] = {outfit = 400, effect = 35, cd = 1, vname = "Sakura", id = 1, msg = "Você ganhou temporariamente um outfit da Sakura!"},
[2] = {outfit = 401, effect = 35, cd = 1, vname = "Sasuke", id = 2, msg = "Você ganhou temporariamente um outfit da Sasuke!"},
[3] = {outfit = 402, effect = 35, cd = 1, vname = "Naruto", id = 3, msg = "Você ganhou temporariamente um outfit da Naruto!"},
}

local storage = 4444 -- storage para nao poder ficar usando toda hora..

function onSay(cid, words, param)

if (param == '') then
        local str = ""
        str = str .. "Vocations:\n\n"
            for a = 1, #vocs do
                str = str..""..vocs[a].vname.."\n"
            end
        doShowTextDialog(cid, 7416, str)
    return true
    end
    
if getPlayerStorageValue(cid, storage) >= 1 then
sendMsgToPlayer(cid, 27, "Você já está usando uma outfit")
return true
end     
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) ~= vocs[x].id then
                sendMsgToPlayer(cid, 27, "Sua vocação é " .. getPlayerVocationName(cid) .."") -- quando alguem tenta usar outfit q n é da sua vocação
            end    
        end        
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) == vocs[x].id then
                addEvent(
                function()
                doRemoveCondition(cid, CONDITION_OUTFIT)
                setPlayerStorageValue(cid, storage, -1)
                end,
                vocs[x].cd * 60 * 1000) -- tempo em minutos para a outfit sair
                doSendMagicEffect(getThingPos(cid), vocs[x].effect) -- efeito que sai quando usa o comando
                doSetCreatureOutfit(cid, {lookType = vocs[x].outfit, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
                setPlayerStorageValue(cid, storage, 1)
                sendMsgToPlayer(cid, 27, vocs[x].msg)
            end    
        end            
return true
end

 

<talkaction hide="yes" words="/out;!out" event="script" value="NomeDoArquivo.lua"/>

 

Editado por gabrielzika (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@leozincorsair post editado, erro corrigido!

Link para o post
Compartilhar em outros sites

Quando eu falo !out até aparece um janela monstrando o nome da vocations

quando eu falo !out sasuke nao faz nada e aparece aquele erro.

Link para o post
Compartilhar em outros sites

@leozincorsair manda o script com as alterações que você fez...

Link para o post
Compartilhar em outros sites
Citar

local vocs = {
[1] = {outfit = 400, effect = 35, cd = 1, vname = "Sakura", id = 1, msg = "Você ganhou temporariamente um outfit da Sakura!"},
[2] = {outfit = 93, effect = 14, cd = 1, vname = "Sasuke", id = 502, msg = "Você ganhou temporariamente um outfit da Sasuke!"},
[3] = {outfit = 402, effect = 35, cd = 1, vname = "Naruto", id = 3, msg = "Você ganhou temporariamente um outfit da Naruto!"},
}

local storage = 4444 -- storage para nao poder ficar usando toda hora..

function onSay(cid, words, param)

if (param == '') then
        local str = ""
        str = str .. "Vocations:\n\n"
            for a = 1, #vocs do
                str = str..""..vocs[a].vname.."\n"
            end
        doShowTextDialog(cid, 7416, str)
    return true
    end
    
if getPlayerStorageValue(cid, storage) >= 1 then
sendMsgToPlayer(cid, 27, "Você já está usando uma outfit")
return true
end     
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) ~= vocs[x].id then
                sendMsgToPlayer(cid, 27, "Sua vocação é " .. getPlayerVocationName(cid) .."") -- quando alguem tenta usar outfit q n é da sua vocação
            end    
        end        
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) == vocs[x].id then
                addEvent(
                function()
                doRemoveCondition(cid, CONDITION_OUTFIT)
                setPlayerStorageValue(cid, storage, -1)
                end,
                vocs[x].cd * 60 * 1000) -- tempo em minutos para a outfit sair
                doSendMagicEffect(getThingPos(cid), vocs[x].effect) -- efeito que sai quando usa o comando
                doSetCreatureOutfit(cid, {lookType = vocs[x].outfit, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
                setPlayerStorageValue(cid, storage, 1)
                sendMsgToPlayer(cid, 27, vocs[x].msg)
            end    
        end            
return true
end

 

Link para o post
Compartilhar em outros sites

@leozincorsair

 

local vocs = {
[1] = {outfit = 400, effect = 35, cd = 1, vname = "Sakura", id = 1, msg = "Você ganhou temporariamente um outfit da Sakura!"},
[2] = {outfit = 93, effect = 14, cd = 1, vname = "Sasuke", id = 502, msg = "Você ganhou temporariamente um outfit da Sasuke!"},
[3] = {outfit = 402, effect = 35, cd = 1, vname = "Naruto", id = 3, msg = "Você ganhou temporariamente um outfit da Naruto!"},
}

local storage = 4444 -- storage para nao poder ficar usando toda hora..

function onSay(cid, words, param)

if (param == '') then
        local str = ""
        str = str .. "Vocations:\n\n"
            for a = 1, #vocs do
                str = str..""..vocs[a].vname.."\n"
            end
        doShowTextDialog(cid, 7416, str)
    return true
    end
    
if getPlayerStorageValue(cid, storage) >= 1 then
sendMsgToPlayer(cid, 27, "Você já está usando uma outfit")
return true
end     
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) ~= vocs[x].id then
                sendMsgToPlayer(cid, 27, "Sua vocação é " .. getPlayerVocationName(cid) .."") -- quando alguem tenta usar outfit q n é da sua vocação
            end    
        end        
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) == vocs[x].id then
                addEvent(
                function()
                doRemoveCondition(cid, CONDITION_OUTFIT)
                setPlayerStorageValue(cid, storage, -1)
                end,
                vocs[x].cd * 60 * 1000) -- tempo em minutos para a outfit sair
                doSendMagicEffect(getThingPos(cid), vocs[x].effect) -- efeito que sai quando usa o comando
                doSetCreatureOutfit(cid, {lookType = vocs[x].outfit, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
                setPlayerStorageValue(cid, storage, 1)
                sendMsgToPlayer(cid, 27, "".. vocs[x].msg.. "")
            end    
        end            
return true
end

 

Link para o post
Compartilhar em outros sites

o erro ainda é o mesmo? de sendmsgplayer???

Link para o post
Compartilhar em outros sites
2 minutos atrás, leozincorsair disse:

sim .

local vocs = {
[1] = {outfit = 400, effect = 35, cd = 1, vname = "Sakura", id = 1, msg = "Você ganhou temporariamente um outfit da Sakura!"},
[2] = {outfit = 93, effect = 14, cd = 1, vname = "Sasuke", id = 502, msg = "Você ganhou temporariamente um outfit da Sasuke!"},
[3] = {outfit = 402, effect = 35, cd = 1, vname = "Naruto", id = 3, msg = "Você ganhou temporariamente um outfit da Naruto!"},
}

local storage = 4444 -- storage para nao poder ficar usando toda hora..

function onSay(cid, words, param)

if (param == '') then
        local str = ""
        str = str .. "Vocations:\n\n"
            for a = 1, #vocs do
                str = str..""..vocs[a].vname.."\n"
            end
        doShowTextDialog(cid, 7416, str)
    return true
    end
    
if getPlayerStorageValue(cid, storage) >= 1 then
doPlayerSendTextMessage(cid, 27, "Você já está usando uma outfit")
return true
end     
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) ~= vocs[x].id then
                doPlayerSendTextMessage(cid, 27, "Sua vocação é " .. getPlayerVocationName(cid) .."") -- quando alguem tenta usar outfit q n é da sua vocação
            end    
        end        
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) == vocs[x].id then
                addEvent(
                function()
                doRemoveCondition(cid, CONDITION_OUTFIT)
                setPlayerStorageValue(cid, storage, -1)
                end,
                vocs[x].cd * 60 * 1000) -- tempo em minutos para a outfit sair
                doSendMagicEffect(getThingPos(cid), vocs[x].effect) -- efeito que sai quando usa o comando
                doSetCreatureOutfit(cid, {lookType = vocs[x].outfit, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
                setPlayerStorageValue(cid, storage, 1)
                doPlayerSendTextMessage(cid, 27, "".. vocs[x].msg.. "")
            end    
        end            
return true
end

 

Teste

Editado por DeeadPool (veja o histórico de edições)

Meu facebook

 

Meu Projeto

 

Meu Skype

Spoiler

brendo.dmg.yago

 

Meu Servidor Online:

Spoiler

 

Link para o post
Compartilhar em outros sites

@leozincorsair

 

Tenta assim:

local vocs = {
[1] = {outfit = 400, effect = 35, cd = 1, vname = "Sakura", id = 1},
[2] = {outfit = 93, effect = 14, cd = 1, vname = "Sasuke", id = 502},
[3] = {outfit = 402, effect = 35, cd = 1, vname = "Naruto", id = 3},
}

local storage = 4444 -- storage para nao poder ficar usando toda hora..

function onSay(cid, words, param)

if (param == '') then
        local str = ""
        str = str .. "Vocations:\n\n"
            for a = 1, #vocs do
                str = str..""..vocs[a].vname.."\n"
            end
        doShowTextDialog(cid, 7416, str)
    return true
    end
    
if getPlayerStorageValue(cid, storage) >= 1 then
doPlayerSendTextMessage(cid,25,"Você já está usando uma outfit.")
return true
end     
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) ~= vocs[x].id then
                doPlayerSendTextMessage(cid,25,"Sua vocação é " .. getPlayerVocationName(cid) ..".")  -- quando alguem tenta usar outfit q n é da sua vocação
            end    
        end        
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) == vocs[x].id then
                addEvent(
                function()
                doRemoveCondition(cid, CONDITION_OUTFIT)
                setPlayerStorageValue(cid, storage, -1)
                end,
                vocs[x].cd * 60 * 1000) -- tempo em minutos para a outfit sair
                doSendMagicEffect(getThingPos(cid), vocs[x].effect) -- efeito que sai quando usa o comando
                doSetCreatureOutfit(cid, {lookType = vocs[x].outfit, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
                setPlayerStorageValue(cid, storage, 1)
                doPlayerSendTextMessage(cid,25,"Você ganhou temporariamente um outfit de ".. vocs[x].vname .."!")
            end    
        end            
return true
end

 

se der outro erro manda ai... desiste não mano!

Link para o post
Compartilhar em outros sites

@leozincorsair Seguinte... tira um print e manda aqui... eu coloquei pra aparecer essa mensagem só quando  exemplo, uma vocação tentasse usar a outfit de outra....

 

 

ex:

 

 

um naruto falando /out sasuke

Link para o post
Compartilhar em outros sites
3 minutos atrás, gabrielzika disse:

@leozincorsair Seguinte... tira um print e manda aqui... eu coloquei pra aparecer essa mensagem só quando  exemplo, uma vocação tentasse usar a outfit de outra....

 

 

ex:

 

 

um naruto falando /out sasuke

 

11111.png

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo