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
[RESOLVIDO] Trocar Looktype e Ficar sem andar
Por HeelNox, 14 de ago. de 2013 em Scripts
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

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 ?
info
Grupo: Conde
Registrado: 20/09/12
Posts: 711
Reputação: +86
Char no Tibia: noé

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
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

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 ?
info
Grupo: Conde
Registrado: 20/09/12
Posts: 711
Reputação: +86
Char no Tibia: noé

/\ 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.
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

aparecendo esse erro ...
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

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
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

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
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

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
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

info
Grupo: Conde
Registrado: 20/09/12
Posts: 711
Reputação: +86
Char no Tibia: noé

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
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

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 Agosto 16 por Roksas
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

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 Agosto 16 por Slicer
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

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 naostorage = 2501, -- Nao mecha}if not out thenreturn trueendif getPlayerStorageValue(cid,config.storage) <= 0 thendoSetCreatureOutfit(cid, out[getPlayerVocation(cid)], -1)setPlayerStorageValue(cid, config.storage, 350)if config.removeSpeed == "sim" thendoCreatureSetNoMove(cid, true)endelsedoRemoveCondition(cid, CONDITION_OUTFIT)setPlayerStorageValue(cid, config.storage, 0)if config.removeSpeed == "sim" thendoCreatureSetNoMove(cid, false)endendreturn trueend
Talkaction.xml
<talkaction words="!sit" event="script" value="sit.lua"/>





info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.
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 Agosto 14 por DarkHeel