doPlayerSetSpecialDescription(thing.uid, "\n[Promotion: " .. a .."]")
troca pra
doPlayerSetSpecialDescription(thing.uid, "\n[Promotion: " .. table .."]")
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

doPlayerSetSpecialDescription(thing.uid, "\n[Promotion: " .. a .."]")
troca pra
doPlayerSetSpecialDescription(thing.uid, "\n[Promotion: " .. table .."]")
info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord

Cara dá esse erro:
[20/01/2013 18:36:41] [Error - CreatureScript Interface]
[20/01/2013 18:36:41] data/creaturescripts/scripts/showVocation.lua:onLook
[20/01/2013 18:36:41] Description:
[20/01/2013 18:36:41] (luaGetCreatureStorage) Creature not found
[20/01/2013 18:36:41] [Error - CreatureScript Interface]
[20/01/2013 18:36:41] data/creaturescripts/scripts/showVocation.lua:onLook
[20/01/2013 18:36:41] Description:
[20/01/2013 18:36:41] data/creaturescripts/scripts/showVocation.lua:9: attempt to concatenate local 'table' (a nil value)
[20/01/2013 18:36:41] stack traceback:
[20/01/2013 18:36:41] data/creaturescripts/scripts/showVocation.lua:9: in function <data/creaturescripts/scripts/showVocation.lua:1>
[20/01/2013 18:36:41] Error during getDataInt(rep).
Editado Janeiro 20 por Skailord
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

function onLook(cid, thing, position, lookDistance)
local table = {
["222"] = getPlayerSex(cid) == PLAYERSEX_MALE and "He's Feiticeiro" or "He's Feiticeira",
["222"] = getPlayerSex(cid) == PLAYERSEX_MALE and "He's Mago" or "He's Maga"
}
local table = table[getPlayerStorageValue(cid)]
if isPlayer(thing.uid) then
doPlayerSetSpecialDescription(thing.uid, "\n[Promotion: " .. table .."]")
end
return true
end
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

mano agora q olhei melhor, esse script ta muito estranhu
as promotions ae sao com storages values? ou sao vocations normais? ![]()
/\ n vai da certo..
table[getPlayerStorageValue(cid)]
Editado Janeiro 20 por Slicer
info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord

são com storage, e skylight o seu num deu certo não:(
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

ta quais sao as storages entao...
info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord

Por enquanto é só uma 3426.
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

dai se o cara tem a promotion essa storage fica com valor 1?
info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord

sim
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

tenta assim..
function onLook(cid, thing, position, lookDistance)
local table = {
--[storage] = descriçao,
[3426] = {male = "He's a Wizard", female = "She's a Wizard"},
}
local descricao = ""
if isPlayer(thing.uid) then
for sto, desc in pairs(table) do
if getPlayerStorageValue(thing.uid, sto) >= 1 then
descricao = getPlayerSex(thing.uid) == 0 and desc.female or desc.male
break
end
end
if descricao == "" then return true end
doPlayerSetSpecialDescription(thing.uid, "\n[Promotion: " .. descricao .."]")
end
return true
end
Editado Janeiro 20 por Slicer
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Cara, é claro que vai dar erro, a tabela tá com dois index iguais .-.
Troca o 222 de um desses dois aqui:
[222] = getPlayerSex(cid) == PLAYERSEX_MALE and "He's Feiticeiro" or "He's Feiticeira", [222] = getPlayerSex(cid) == PLAYERSEX_MALE and "He's Mago" or "He's Maga"
Além do que a variável table tá com o mesmo nome da table .-.
Editado Janeiro 20 por LuckOake
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

tinha muitos outros erros luck '--'
info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord

Cara deu esse erro: [20/01/2013 19:26:34] Error during getDataInt(rep).
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

É, realmente.
function onLook(cid, thing, position, lookDistance)
local vocs = {
[1] = getPlayerSex(cid) == PLAYERSEX_MALE and "He's Feiticeiro" or "He's Feiticeira",
[2] = getPlayerSex(cid) == PLAYERSEX_MALE and "He's Mago" or "He's Maga",
}
local table = vocs[getPlayerStorageValue(cid, 222)]
if not table then return true end
if isPlayer(thing.uid) then
doPlayerSetSpecialDescription(thing.uid, "\n[Promotion: " .. table .."]")
end
return true
end
Dei uma arrumada no script.
Editado Janeiro 20 por LuckOake
info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord
Galera eu vi uma script do #Skaymagnum que adiciona uma palavra quando se dá look, só que esta com erro, toda vez que eu dou look no player dá um erro ai o forgotem dá pau e fecha num se qual é o problema, quem ajudar rep ++.
creaturescripts/scripts/showvocation.lua:
function onLook(cid, thing, position, lookDistance) local table = { [222] = getPlayerSex(cid) == PLAYERSEX_MALE and "He's Feiticeiro" or "He's Feiticeira", [222] = getPlayerSex(cid) == PLAYERSEX_MALE and "He's Mago" or "He's Maga" } local table = table[getPlayerStorageValue(cid)] if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n[Promotion: " .. a .."]") end return true endTag creaturescript.xml:
Tag creaturescript/scripts/ loguin.lua:
Editado Janeiro 20 por LuckOake
Arrumando a formatação