Ir para conteúdo
  • Cadastre-se

Normal [Pedido] Ajuda com Script de Look Player !!


Posts Recomendados

Seguinte Galera tenho 2 Scripts de Look Player

O Primeiro é Fica Assim quando da Look no Player!

Citar

You see Teste (Level 8). He is a elder druid. He is Leader of the Malucos (Zicao).
Ele Matou: [2] Jogadores.
Ele Morreu: [1] Jogadores

Aqui está o Script

Spoiler

function onLook(cid, thing, position, lookDistance)
function getDeathsAndKills(cid, type) -- by vodka
local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
if (query:getID() ~= -1) then 
repeat
d = d+1
until not query:next()
query:free()
end
return d 
end
if isPlayer(thing.uid) then
doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Jogadores")
end
return true
end

 

E Tenho Este Script de Rank Militar em Mods

Spoiler

<?xml version = "1.0" encoding = "UTF-8"?>
    <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes">
        <config name = "ranks"><![CDATA[
            titles = {
                [5] = "Private First Class",
                [10] = "Specialist",
                [15] = "Corporal",
                [20] = "Sergeant",
                [25] = "Staff Sergeant",
                [30] = "Sergeant First Class",
                [35] = "Master Sergeant",
                [40] = "First Sergeant",
                [45] = "Sergeant Major",
                [50] = "Command Sergeant Major",
                [55] = "Sergeant Major of the Army",
                [60] = "Second Lieutenant",
                [65] = "First Lieutenant",
                [70] = "Captain",
                [75] = "Major",
                [80] = "Lieutenant Colonel",
                [90] = "Colonel",
                [100] = "Brigadier General",
                [110] = "Major General",
                [120] = "Lieutenant General",
                [140] = "General",
                [170] = "General of the Army"
            }
            fragsStorage = 600
        ]]></config>
        <event type = "look" name = "ranksLook" event = "script"><![CDATA[
            domodlib("ranks")
            function onLook(cid, thing, position, lookDistance)
                if(isPlayer(thing.uid)) then
                    local rank = {rank = "Private", frags = 0}
                    for k, v in pairs(titles) do
                        if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then
                            if(k - 1 > rank.frags) then
                                rank.rank, rank.frags = v, k - 1
                            end
                        end
                    end
                    doPlayerSetSpecialDescription(thing.uid, "\n Military rank: " .. rank.rank)
                end
                return true
            end
        ]]></event>
        <event type = "kill" name = "ranksKill" event = "script"><![CDATA[
            domodlib("ranks")
            function onKill(cid, target)
                if(isPlayer(target)) then
                    setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1))
                    if(titles[getPlayerStorageValue(cid, fragsStorage)]) then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!")
                    end
                end
                return true
            end
        ]]></event>
        <event type = "login" name = "ranksLogin" event = "script"><![CDATA[
            function onLogin(cid)
                registerCreatureEvent(cid, "ranksKill")
                registerCreatureEvent(cid, "ranksLook")
                return true
            end
        ]]></event>
    </mod>

 

Queria Juntar os Dois, Tipo na hora de dar look mostrar o level,guild,frags,dead e rank militar

Exemplo;

Citar

You see Teste (Level 8). He is a elder druid. He is Leader of the Malucos (Zicao).
Ele Matou: [2] Jogadores.
Ele Morreu: [1] Jogadores

Rank Militar:Private First Class

Alguem que entenda de Scripts,.... Poderia fazer para min ?

Ficaria muito Grato Mesmo e me Ajudaria Muuuuuitooo!

DOU MUITO REPS ! Prometo

Editado por DigoleraZica
Erro de Escrita =s (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
function getDeathsAndKills(cid, type) -- by vodka
local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
if (query:getID() ~= -1) then 
repeat
d = d+1
until not query:next()
query:free()
end
return d 
end
if isPlayer(thing.uid) then
doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Jogadores")
end

<?xml version = "1.0" encoding = "UTF-8"?>
    <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes">
        <config name = "ranks"><![CDATA[
            titles = {
                [5] = "Private First Class",
                [10] = "Specialist",
                [15] = "Corporal",
                [20] = "Sergeant",
                [25] = "Staff Sergeant",
                [30] = "Sergeant First Class",
                [35] = "Master Sergeant",
                [40] = "First Sergeant",
                [45] = "Sergeant Major",
                [50] = "Command Sergeant Major",
                [55] = "Sergeant Major of the Army",
                [60] = "Second Lieutenant",
                [65] = "First Lieutenant",
                [70] = "Captain",
                [75] = "Major",
                [80] = "Lieutenant Colonel",
                [90] = "Colonel",
                [100] = "Brigadier General",
                [110] = "Major General",
                [120] = "Lieutenant General",
                [140] = "General",
                [170] = "General of the Army"
            }
            fragsStorage = 600
	function getDeathsAndKills(cid, type) -- by vodka
		local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
			if (query:getID() ~= -1) then 
				repeat
					d = d+1
				until not query:next()
			query:free()
			end
			return d 
	end
        ]]></config>
        <event type = "look" name = "ranksLook" event = "script"><![CDATA[
            domodlib("ranks")
            function onLook(cid, thing, position, lookDistance)
                if(isPlayer(thing.uid)) then
                    local rank = {rank = "Private", frags = 0}
                    for k, v in pairs(titles) do
                        if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then
                            if(k - 1 > rank.frags) then
                                rank.rank, rank.frags = v, k - 1
                            end
                        end
                    end
                    doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Vezes.\n Military rank: " .. rank.rank)
                end
                return true
            end
        ]]></event>
        <event type = "kill" name = "ranksKill" event = "script"><![CDATA[
            domodlib("ranks")
            function onKill(cid, target)
                if(isPlayer(target)) then
                    setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1))
                    if(titles[getPlayerStorageValue(cid, fragsStorage)]) then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!")
                    end
                end
                return true
            end
        ]]></event>
        <event type = "login" name = "ranksLogin" event = "script"><![CDATA[
            function onLogin(cid)
                registerCreatureEvent(cid, "ranksKill")
                registerCreatureEvent(cid, "ranksLook")
                return true
            end
        ]]></event>
    </mod>

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

@Vodkart Apareceu este erro na minha otx 8.6 ao abrir ela

 

Spoiler

[Error - Test Interface]
data/creaturescripts/scripts/KillsandDeath.lua
Description:
data/creaturescripts/scripts/KillsandDeath.lua:11: attempt to index global 'thing' (a nil value)
[Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/KillsandDeath.lua)

 

entrei no jogo e dei look apareceu isso na otx \/

Spoiler

[Error - CreatureScript Interface]
domodlib("ranks")
            function onLook(cid, thing, position, lookDistance)
                if(isPlayer(thing.uid)) then
                    local rank = {rank = "Private", frags = 0}
                    for k, v in pairs(titles) do
                        if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then
                            if(k - 1 > rank.frags) then
                                rank.rank, rank.frags = v, k - 1
                            end
                        end
                    end
                    doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Vezes.\n Military rank: " .. rank.rank)
                end
                return true
            end
:onLook
Description:
[string "LuaInterface::loadBuffer"]:6: bad argument #3 to 'max' (number expected, got nil)
stack traceback:
        [C]: in function 'max'
        [string "LuaInterface::loadBuffer"]:6: in function <[string "LuaInterface::loadBuffer"]:2>

 

Editado por DigoleraZica (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 1 year later...

Vou ver se tento atualizar esse script do vodkart, mas meus conhecimentos são bem básicos.

Caso consiga postarei aqui/na seção correta.

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo