Ir para conteúdo
  • 0

[RESOLVIDO] Trocar Looktype e Ficar sem andar


HeelNox

Pergunta

Gostaria de um script da seguinte forma



Quando tal vocação usar tal comando muda-se a looktype e fica-se sem se mover , mais quando usar ele denovo volta-se a se mover e a looktype que estava antes


Editado por DarkHeel
Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0


local config = {
outfitId = 200, -- Id da outfit
removeSpeed = "sim", -- sim ou nao
storage = 2501, -- Nao mecha
}


function onSay(cid, words, param, channel)


if getPlayerStorageValue(cid,config.storage) <= 0 then
doSetCreatureOutfit(cid, {lookType = config.outfitId}, -1)
setPlayerStorageValue(cid, config.storage, 350)
if config.removeSpeed == "sim" then
doCreatureSetNoMove(cid, true)
end
else
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, config.storage, 0)
if config.removeSpeed == "sim" then
doCreatureSetNoMove(cid, false)
end
end


return true
end


Link para o comentário
Compartilhar em outros sites

  • 0

 

local config = {
outfitId = 200, -- Id da outfit
removeSpeed = "sim", -- sim ou nao
        storage = 2501, -- Nao mecha
}


function onSay(cid, words, param, channel)


  if getPlayerStorageValue(cid,config.storage) <= 0 then
     doSetCreatureOutfit(cid, {lookType = config.outfitId}, -1)
     setPlayerStorageValue(cid, config.storage, 350) 
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, true)
       end
  else
     doRemoveCondition(cid, CONDITION_OUTFIT) 
     setPlayerStorageValue(cid, config.storage, 0) 
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, false)
       end
  end


return true
end
  

 

 

Mais eu gostaria que cada vocação usa-se certa looktype se der , onde ponho isso ?

Link para o comentário
Compartilhar em outros sites

  • 0

 

local out = {
[1] = 123, -- VOCATION / LOOKTYPE
[2] = 321,
[3] = 321,
[4] = 321
}
local config = {
removeSpeed = "sim", -- sim ou nao
        storage = 2501, -- Nao mecha
}


function onSay(cid, words, param, channel)


  if getPlayerStorageValue(cid,config.storage) <= 0 then
     doSetCreatureOutfit(cid,out[getPlayerVocation(cid)])
     setPlayerStorageValue(cid, config.storage, 350) 
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, true)
       end
  else
     doRemoveCondition(cid, CONDITION_OUTFIT) 
     setPlayerStorageValue(cid, config.storage, 0) 
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, false)
       end
  end


return true
end
Link para o comentário
Compartilhar em outros sites

  • 0
local out = {
[1] = 123, -- VOCATION / LOOKTYPE
[2] = 321,
[3] = 321,
[4] = 321
}
local config = {
removeSpeed = "sim", -- sim ou nao
        storage = 2501, -- Nao mecha
}


function onSay(cid, words, param, channel)


  if getPlayerStorageValue(cid,config.storage) <= 0 then
     doSetCreatureOutfit(cid,out[getPlayerVocation(cid)])
     setPlayerStorageValue(cid, config.storage, 350) 
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, true)
       end
  else
     doRemoveCondition(cid, CONDITION_OUTFIT) 
     setPlayerStorageValue(cid, config.storage, 0) 
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, false)
       end
  end


return true
end

Issu e talk ?

Link para o comentário
Compartilhar em outros sites

  • 0

/\ sim, é o script do Smix, eu so coloquei as vocations, e as out, so voce editar.

 

local out = {
[1] = 123, -- VOCATION / LOOKTYPE
[2] = 321,
[3] = 321,
[4] = 321
}

 

em [] é vocation.

Link para o comentário
Compartilhar em outros sites

  • 0

aparecendo esse erro ...

 

[16/08/2013 17:31:44] [Error - TalkAction Interface]
[16/08/2013 17:31:44] data/talkactions/scripts/sit.lua:onSay
[16/08/2013 17:31:44] Description:
[16/08/2013 17:31:44] attempt to index a number value
[16/08/2013 17:31:44] stack traceback:
[16/08/2013 17:31:44] [C]: in function 'doSetCreatureOutfit'
[16/08/2013 17:31:44] data/talkactions/scripts/sit.lua:16: in function <data/talkactions/scripts/sit.lua:12>
Link para o comentário
Compartilhar em outros sites

  • 0

Tenta:

 

 

local out = {
[1] = 123, -- VOCATION / LOOKTYPE
[2] = 321,
[3] = 321,
[4] = 321,
}

local config = {
removeSpeed = "sim", -- sim ou nao
        storage = 2501, -- Nao mecha
}


function onSay(cid, words, param, channel)


  if getPlayerStorageValue(cid,config.storage) <= 0 then
     doSetCreatureOutfit(cid, out[getPlayerVocation(cid)], -1)
     setPlayerStorageValue(cid, config.storage, 350)
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, true)
       end
  else
     doRemoveCondition(cid, CONDITION_OUTFIT)
     setPlayerStorageValue(cid, config.storage, 0)
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, false)
       end
  end


return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

 

Tenta:

local out = {
[1] = 123, -- VOCATION / LOOKTYPE
[2] = 321,
[3] = 321,
[4] = 321,
}

local config = {
removeSpeed = "sim", -- sim ou nao
        storage = 2501, -- Nao mecha
}


function onSay(cid, words, param, channel)


  if getPlayerStorageValue(cid,config.storage) <= 0 then
     doSetCreatureOutfit(cid, out[getPlayerVocation(cid)], -1)
     setPlayerStorageValue(cid, config.storage, 350)
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, true)
       end
  else
     doRemoveCondition(cid, CONDITION_OUTFIT)
     setPlayerStorageValue(cid, config.storage, 0)
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, false)
       end
  end


return true
end
[16/08/2013 17:46:27] [Error - TalkAction Interface]
[16/08/2013 17:46:27] data/talkactions/scripts/sit.lua:onSay
[16/08/2013 17:46:27] Description:
[16/08/2013 17:46:27] attempt to index a number value
[16/08/2013 17:46:27] stack traceback:
[16/08/2013 17:46:27] [C]: in function 'doSetCreatureOutfit'
[16/08/2013 17:46:27] data/talkactions/scripts/sit.lua:16: in function <data/talkactions/scripts/sit.lua:12>
Link para o comentário
Compartilhar em outros sites

  • 0

A tabela estava fora da função main, não encontrava o parâmetro cid, rsrs. Tente agora:

 

 

function onSay(cid, words, param, channel)

local out = {
[1] = 123, -- VOCATION / LOOKTYPE
[2] = 321,
[3] = 321,
[4] = 321,
}

local config = {
removeSpeed = "sim", -- sim ou nao
        storage = 2501, -- Nao mecha
}


  if getPlayerStorageValue(cid,config.storage) <= 0 then
     doSetCreatureOutfit(cid, out[getPlayerVocation(cid)], -1)
     setPlayerStorageValue(cid, config.storage, 350)
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, true)
       end
  else
     doRemoveCondition(cid, CONDITION_OUTFIT)
     setPlayerStorageValue(cid, config.storage, 0)
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, false)
       end
  end


return true
end

 

#GoodLuck

Link para o comentário
Compartilhar em outros sites

  • 0
[16/08/2013 18:11:58] [Error - TalkAction Interface]

[16/08/2013 18:11:58] data/talkactions/scripts/sit.lua:onSay

[16/08/2013 18:11:58] Description:

[16/08/2013 18:11:58] attempt to index a nil value

[16/08/2013 18:11:58] stack traceback:

[16/08/2013 18:11:58] [C]: in function 'doSetCreatureOutfit'

[16/08/2013 18:11:58] data/talkactions/scripts/sit.lua:17: in function <data/talkactions/scripts/sit.lua:1>

Link para o comentário
Compartilhar em outros sites

  • 0

 

function onSay(cid, words, param, channel)

local out = {
[1] = 123, -- VOCATION / LOOKTYPE
[2] = 321,
[3] = 321,
[4] = 321,
}

local config = {
removeSpeed = "sim", -- sim ou nao
        storage = 2501, -- Nao mecha
}


  if getPlayerStorageValue(cid,config.storage) <= 0 then
     setCreatureOutfit(cid, out[getPlayerVocation(cid)], -1)
     setPlayerStorageValue(cid, config.storage, 350)
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, true)
       end
  else
     doRemoveCondition(cid, CONDITION_OUTFIT)
     setPlayerStorageValue(cid, config.storage, 0)
       if config.removeSpeed == "sim" then
          doCreatureSetNoMove(cid, false)
       end
  end


return true
end
Link para o comentário
Compartilhar em outros sites

  • 0


function onSay(cid, words, param, channel)

 

local out = {

[1] = 123, -- VOCATION / LOOKTYPE

[2] = 321,

[3] = 321,

[4] = 321,

}

 

local config = {

removeSpeed = "sim", -- sim ou nao

storage = 2501, -- Nao mecha

outs = out[getPlayerVocation(cid)],

}

 

if not config.outs then

return true

end

 

 

if getPlayerStorageValue(cid,config.storage) <= 0 then

doSetCreatureOutfit(cid, out[getPlayerVocation(cid)], -1)

setPlayerStorageValue(cid, config.storage, 350)

if config.removeSpeed == "sim" then

doCreatureSetNoMove(cid, true)

end

else

doRemoveCondition(cid, CONDITION_OUTFIT)

setPlayerStorageValue(cid, config.storage, 0)

if config.removeSpeed == "sim" then

doCreatureSetNoMove(cid, false)

end

end

 

 

return true

end

Editado por Roksas
Link para o comentário
Compartilhar em outros sites

  • 0

q mania de vcs tentarem fazer tudo direto --'

n sabem fazer...

if not out[getPlayerVocation(cid)] then
   return false
end

?????

 

-sem fla clr q o dono do topico nem deve ta mudando a tabela...-

Editado por Slicer
Link para o comentário
Compartilhar em outros sites

  • 0

O Erro

 

[16/08/2013 18:39:36] [Error - TalkAction Interface]

[16/08/2013 18:39:36] data/talkactions/scripts/sit.lua:onSay
[16/08/2013 18:39:36] Description:
[16/08/2013 18:39:36] attempt to index a nil value
[16/08/2013 18:39:36] stack traceback:
[16/08/2013 18:39:36] [C]: in function 'doSetCreatureOutfit'
[16/08/2013 18:39:36] data/talkactions/scripts/sit.lua:20: in function <data/talkactions/scripts/sit.lua:1>

o Script

 

function onSay(cid, words, param, channel)

local out = {
[1] = 538, -- VOCATION / LOOKTYPE
[2] = 585,
[3] = 536,
}
local config = {
removeSpeed = "sim", -- sim ou nao
storage = 2501, -- Nao mecha
}
if not out then
return true
end
if getPlayerStorageValue(cid,config.storage) <= 0 then
doSetCreatureOutfit(cid, out[getPlayerVocation(cid)], -1)
setPlayerStorageValue(cid, config.storage, 350)
if config.removeSpeed == "sim" then
doCreatureSetNoMove(cid, true)
end
else
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, config.storage, 0)
if config.removeSpeed == "sim" then
doCreatureSetNoMove(cid, false)
end
end
return true
end

 

Talkaction.xml

<talkaction words="!sit" event="script" value="sit.lua"/>

 

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...