Servidor 13x Gana oro matando jugadores

Prototype

Miembro
LV
11
 
Awards
6
Buenas tardes chicos, ¿podrían ayudarme a adaptar este script a la nueva versión?

Necesito que ganes oro cuando mates a otro jugador.
Quizás podríamos usar este antiguo script como base:

Código Lua:
function onKill(cid, target, lastHit)
if isPlayer(cid) and isPlayer(target) then
if getPlayerIp(target) ~= getPlayerIp(cid) then
doPlayerAddItem(cid, 2160, 1)
end
end
return TRUE
end
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Buenas tardes chicos, ¿podrían ayudarme a adaptar este script a la nueva versión?

Necesito que ganes oro cuando mates a otro jugador.
Quizás podríamos usar este antiguo script como base:

Código Lua:
function onKill(cid, target, lastHit)
if isPlayer(cid) and isPlayer(target) then
if getPlayerIp(target) ~= getPlayerIp(cid) then
doPlayerAddItem(cid, 2160, 1)
end
end
return TRUE
end
Hola
Antiguo a la nueva versión es decir ? Utilizando revscript ?
En ese caso es un un CreatureEvent, para que consigas hacerlo en los próximos scripts , descarga Visual Studio Code abre la carpeta de tu servidor y en la búsqueda busca onKill , fíjate que los scripts son similares pero al principio trae un local xxxx = CreatureEvent(« xxxxx « ) delante del onKill un punto con el nombre del local , xxxx.onKill y al final del script el xxxx:register() , donde los xxxx haz lo mismo en tu antiguo script y lo tendrás convertido en revscript.
Estoy en el móvil , pruébalo más tarde sino te escribo el ejemplo por pc.
 

Prototype

Miembro
LV
11
 
Awards
6
Hola muchas gracias por tu ayuda.
Estoy aprendiendo lua, lo intentaré y volveré con la respuesta.
Hola
Antiguo a la nueva versión es decir ? Utilizando revscript ?
En ese caso es un un CreatureEvent, para que consigas hacerlo en los próximos scripts , descarga Visual Studio Code abre la carpeta de tu servidor y en la búsqueda busca onKill , fíjate que los scripts son similares pero al principio trae un local xxxx = CreatureEvent(« xxxxx « ) delante del onKill un punto con el nombre del local , xxxx.onKill y al final del script el xxxx:register() , donde los xxxx haz lo mismo en tu antiguo script y lo tendrás convertido en revscript.
Estoy en el móvil , pruébalo más tarde sino te escribo el ejemplo por pc.
 

Prototype

Miembro
LV
11
 
Awards
6
Hola muchas gracias por tu ayuda.
Estoy aprendiendo lua, lo intentaré y volveré con la respuesta.

Código Lua:
local goldKill = CreatureEvent("goldKill")

function onKill(cid, target, lastHit)
if player:isPlayer and target:isPlayer then
player:addItem(3043, 1)
end

end


goldKill:register()

¿Sería así?
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Código Lua:
local goldKill = CreatureEvent("goldKill")

function onKill(cid, target, lastHit)
if player:isPlayer and target:isPlayer then
player:addItem(3043, 1)
end

end


goldKill:register()

¿Sería así?
Ahora delante del onKill tienes que ponerle goldKill.onKill y así lo habrás transformado en revscript.

Quedaría function goldKill.onKill(…..)
 

Prototype

Miembro
LV
11
 
Awards
6
Código Lua:
local goldKill = CreatureEvent("goldKill")


function goldKill.onKill(cid, target, lastHit)
if player:isPlayer and target:isPlayer then
player:addItem(3043, 1)
end
return true
end


goldKill:register()


Certo! Obrigado mais uma vez..

Obtive um erro:
goldkill.lua:4: function arguments expected near 'and'
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Código Lua:
local goldKill = CreatureEvent("goldKill")


function goldKill.onKill(cid, target, lastHit)
if player:isPlayer and target:isPlayer then
player:addItem(3043, 1)
end
return true
end


goldKill:register()


Certo! Obrigado mais uma vez..

Obtive um erro:
goldkill.lua:4: function arguments expected near 'and'

Prueba if player and target:isPlayer then
 

Prototype

Miembro
LV
11
 
Awards
6
Intento así pero no pasa nada, tampoco aparece ningún error.

Código Lua:
local goldKill = CreatureEvent("goldKill")

function goldKill.onKill(cid, target, lastHit)
if player() and target:isPlayer() then
player:addItem(3043, 1)
end
return true
end

goldKill:register()

obs:
Puse () delante del Player
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Intento así pero no pasa nada, tampoco aparece ningún error.

Código Lua:
local goldKill = CreatureEvent("goldKill")

function goldKill.onKill(cid, target, lastHit)
if player() and target:isPlayer() then
player:addItem(3043, 1)
end
return true
end

goldKill:register()

obs:
Puse () delante del Player


No, correctamente es como lo mandé, pero deberas de cambiar el cid por el player:

Prueba este

Código Lua:
local goldKill = CreatureEvent("goldKill")

function goldKill.onKill(player, target, lastHit)
if player and target:isPlayer() then
player:addItem(3043, 1)
end
return true
end

goldKill:register()
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
no hay error, pero no funcionó, no pasa nada cuando el jugador mata al otro


Código Lua:
local goldKill = CreatureEvent("goldKill")


function goldKill.onKill(player, target, lastHit)
if player:isPlayer and target:isPlayer then
player:addItem(3043, 1)
end
return true
end


goldKill:register()
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Vaya es el and target:isPlayer , que causa problema parece.
Habría que encontrar un script PVP de la última versión y ver , por ejemplo en canary hay obtener experiencia por matar players buscar esa parte y ver cómo está indicada en la función e utilizar la misma.
 

Shuyin

Miembro
LV
23
 
Awards
17
Código Lua:
local goldKill = CreatureEvent("goldKill")

function goldKill.onKill(player, target, lastHit)
    if player:isPlayer() and target:isPlayer() then
        player:addItem(3043, 1)
    end
    return true
end

goldKill:register()

esto "goldKill" agregalo en login events tambien, dentro de creaturescripts/others

De esa manera cada vez que mate un player a otro le dara 1cc o lo que pongas.
 

Damian1234

Miembro
LV
14
 
Awards
15
Código Lua:
local goldKill = CreatureEvent("goldKill")

function goldKill.onKill(player, target, lastHit)
    if player:isPlayer() and target:isPlayer() then
        player:addItem(3043, 1)
    end
    return true
end

goldKill:register()

esto "goldKill" agregalo en login events tambien, dentro de creaturescripts/others

De esa manera cada vez que mate un player a otro le dara 1cc o lo que pongas.
Este podria funcionar para poner un "skull" al matar al player pero como podria quedar para que esa "skull" tenga descripcion como de You see "Nombre del Player" Skull?
 
Arriba