Fala pessoal , vi muita galera com problema no look (principalmente em narutibias). Então resolvi refazer o sistema de look
Crie um novo arquivo em Creaturescripts e cole isso ( Tem que registrar na XML e no login.lua, ambas tags estão na script)
-- <event type="look" name="showVoc" event="script" value="showvoc.lua"/> -- registerCreatureEvent(cid, showVoc) local t = { [-1] = "Estudante", [0] = "Estudante", [1] = "Genin", [2] = "Chunnin", [3] = "Jounin", [4] = "Anbu", [5] = "Sennin" } function onLook(cid, thing, position, lookDistance) local storage = 35461 local get_description = t[getPlayerStorageValue(thing.uid, storage)] local get_sex = (getPlayerSex(thing.uid) == 0 and "She" or "He") local get_town = getTownName(getPlayerTown(thing.uid)) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid, "\n ".. get_sex .." are ".. get_description ..". \n ".. get_sex .." is the resident of ".. get_town ..".") end return true end
Como o sistema funciona ? como eu configuro ?
Primeiramente , a script pega o valor que o player tem de uma storage e a identifica na tabela , onde o que está entre "[]" é o valor da storage
Exemplo : O player tem a storage 35461 e 3 como o value dela , então no look retornará Jounin
Para configurar , mecha aqui
local t = { [-1] = "Estudante", [0] = "Estudante", [1] = "Genin", [2] = "Chunnin", [3] = "Jounin", [4] = "Anbu", [5] = "Sennin" }
Lembrando que a ultima parte não deverá conter virgula , ficando assim
local t = { [-1] = "Estudante", [0] = "Estudante", [1] = "Genin" }
A script não funciona se você der look em si mesmo.
Chars com group maior que 2 retornarão erro ao dar look.