Continua mesmo erro !!!
[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.

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

Fiz um do início, vamos ver se funciona agora:
function onSay(cid, words, param)
local vocs = {
[1] = 123,
[2] = 231,
[3] = 98,
[4] = 76,
}
if not vocs[getPlayerVocation(cid)] then
return true
end
if getPlayerStorageValue(cid, 9329) < 1 then
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
doSetCreatureOutfit(cid, vocs[getPlayerVocation(cid)], -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end
Nesta parte, você tem que mudar:
local vocs = {
[1] = 123,
[2] = 231,
[3] = 98,
[4] = 76,
}
Entre [ e ] é o ID da vocação e o número ao lado é o lookType.
#GoodLuck.
Editado Agosto 17 por Roksas
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

/\
falto fechar o if com um end ai fera xd
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

Funcionou mais não ta trocando a looktype
[17/08/2013 10:12:49] [Error - TalkAction Interface][17/08/2013 10:12:49] data/talkactions/scripts/sit.lua:onSay[17/08/2013 10:12:49] Description:[17/08/2013 10:12:49] attempt to index a number value[17/08/2013 10:12:49] stack traceback:[17/08/2013 10:12:49] [C]: in function 'doSetCreatureOutfit'[17/08/2013 10:12:49] data/talkactions/scripts/sit.lua:16: in function <data/talkactions/scripts/sit.lua:1>
Editado Agosto 17 por DarkHeel
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

vc mudou os ids ta looktype?
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

vc mudou os ids ta looktype?
Sim
function onSay(cid, words, param)
local vocs = {[1] = 538,[2] = 585,[3] = 536,}if not vocs[getPlayerVocation(cid)] thenreturn trueendif getPlayerStorageValue(cid, 9329) < 1 thendoCreatureSetNoMove(cid, true)setPlayerStorageValue(cid, 9329, 1)doSetCreatureOutfit(cid, vocs[getPlayerVocation(cid)], -1)elseif getPlayerStorageValue(cid, 9329) >= 1 thendoCreatureSetNoMove(cid, false)setPlayerStorageValue(cid, 9329, -1)doRemoveCondition(cid, CONDITION_OUTFIT)endreturn trueend
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

ah eh pq o roksas não usou o parâmetro certo na função, tem que colocar {lookType}
function onSay(cid, words, param)
local vocs = {
[1] = 538,
[2] = 585,
[3] = 536,
}
if not vocs[getPlayerVocation(cid)] then
return true
end
if getPlayerStorageValue(cid, 9329) < 1 then
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end
Editado Agosto 17 por Vodkart
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Ah perdão galera, me esqueci que é uma tabela outfits rsrs. {lookType, lookHead, lookBody, etc}.
#GoodLuck!
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

Vlw REP+ para os dois , mais teria como por para healar 5 de hp por segundo ?

Editado Agosto 17 por DarkHeel
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

#Perfect
function onSay(cid, words, param)
local hpGain = 5
local vocs = {
[1] = 538,
[2] = 585,
[3] = 536,
}
if not vocs[getPlayerVocation(cid)] then
return true
end
if getPlayerStorageValue(cid, 9329) < 1 then
heal(cid, hpGain)
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end
function heal(uid, hp)
if not isPlayer(uid) then
return true
end
if getPlayerStorageValue(uid, 9329) < 1 then
return true
end
doCreatureAddHealth(uid, hp)
return addEvent(heal, 1 * 1500, uid, hp)
end
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

#Perfect
function onSay(cid, words, param) local hpGain = 5 local vocs = { [1] = 538, [2] = 585, [3] = 536, } if not vocs[getPlayerVocation(cid)] then return true end if getPlayerStorageValue(cid, 9329) < 1 then heal(cid, hpGain) doCreatureSetNoMove(cid, true) setPlayerStorageValue(cid, 9329, 1) doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1) elseif getPlayerStorageValue(cid, 9329) >= 1 then doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, 9329, -1) doRemoveCondition(cid, CONDITION_OUTFIT) end return true end function heal(uid, hp) if not isPlayer(uid) then return true end if getPlayerStorageValue(uid, 9329) < 1 then return true end doCreatureAddHealth(uid, hp) return addEvent(heal, 1 * 1500, uid, hp) end
Num ta healando D=
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Tente com um player, e tenha certeza de que sua vida não está cheia ¬¬
info
Grupo: Conde
Registrado: 20/09/12
Posts: 711
Reputação: +86
Char no Tibia: noé

tome esse. acho que ele eskeçeu de colocar o hpGain no ultimo rs.
function onSay(cid, words, param)
local hpGain = 5
local vocs = {
[1] = 538,
[2] = 585,
[3] = 536,
}
if not vocs[getPlayerVocation(cid)] then
return true
end
if getPlayerStorageValue(cid, 9329) < 1 then
heal(cid, hpGain)
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end
function heal(uid, hp)
if not isPlayer(uid) then
return true
end
if getPlayerStorageValue(uid, 9329) < 1 then
return true
end
doCreatureAddHealth(uid, hpGain)
return addEvent(heal, 1 * 1500, uid, hp)
end




info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino
Dark, eu tinha mudado o meu script, ve la meu ultimo post.