local pvpParcent = 2 -- porcentagem 2 = 20%
local fromPosition = {x = 1186, y = 1072, z = 7} -- canto superior esquerdo do teu mapa
local toPosition = {x = 1195, y = 1081, z = 7} -- canto inferior direito do teu mapa
function gainExperience(cid, lastHitKiller, mostDamageKiller)
if isPlayer(lastHitKiller) and isPlayer(mostDamageKiller) and lastHitKiller ~= mostDamageKiller then
doPlayerAddExp(lastHitKiller, (getPlayerExperience(cid)/200)*pvpParcent)
end
end
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) and isInArea(getPlayerPosition(cid), fromPosition, toPosition) then
gainExperience(cid, lastHitKiller, mostDamageKiller)
end
return TRUE
end
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- [Ajuda Pelo Amor De Jahhh] Scrpt Pvp Enfo Em Uma Area Ou Ganhar Item Qndo Matar Em Uma Area
AN
[Ajuda Pelo Amor De Jahhh] Scrpt Pvp Enfo Em Uma Area Ou Ganhar Item Qndo Matar Em Uma Area
Por AndreAmaral, 20 de dez. de 2011 em Archived
pvp enfo
ajuda enfo
pvparea
pvpemarea
tibia
script
otserv
3
670
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

20 de dezembro de 2011 às 13:41
info
Grupo: Campones
Registrado: 13/12/11
Posts: 9
Reputação: 0

20 de dezembro de 2011 às 14:00
VLWWW VODKARTTTT VOU TESTAR E JA VOLTO PRA POSTAR SE FUNFOU! =D
Nem Funfou Manoooo =(((((((((((( n da Bug nenhum nem dá a xp... Botei No Login.lua e botei no CreatureScrpt a Function type "PrepareDeath" mas n foi n :S


info
Grupo: Campones
Registrado: 13/12/11
Posts: 9
Reputação: 0
Tipo do script: CreatureScript
Protocolo (versão do Tibia): 8.60
Servidor utilizado: The Forgotten Server
Nível de experiência: baixa/media
Adicionais/Informações:
DAREI 3x REP +++
Galera To Precisando URGENTEMENTE :S De um scrpt que qndo a pessoa matar em UMA determinada AREA Ganhe XP, ou então qndo matar em uma AREA ganhe um item ,porem queria pedir pra vcs se ganhar um item se pode fazer um npc que troque o item por Xp .
Um brother tentou me ajudar mas ele ta sem tempo pra ver ele me mando esse scrpt aqui pra ganhar xp qndo matar , porem esta com o seguinte erro :
[19/12/2011 12:24:51] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/pvpxp.lua:3: unexpected symbol near 'local'
[19/12/2011 12:24:51] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/pvpxp.lua)
[19/12/2011 12:24:51] data/creaturescripts/scripts/pvpxp.lua:3: unexpected symbol near 'local'
DAÍ EU TIRO TODOS "LOCAL" E DA ESSE ERRO AQUI :
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/pvpxp.lua:5: '(' expected near 'gainExperience'
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/pvpxp.lua)
data/creaturescripts/scripts/pvpxp.lua:5: '(' expected near 'gainExperience'
O SCRIPT QUE ELE ME MANDOU E ESSE AQUI :
local pvpParcent = 2 -- porcentagem, 2 = 20%
local fromPosition = {x = 1186, y = 1072, z = 7}, -- canto superior esquerdo do teu mapa
local toPosition = {x = 1195, y = 1081, z = 7}, -- canto inferior direito do teu mapa
function gainExperience(cid, lastHitKiller, mostDamageKiller)
if (isPlayer(lastHitKiller) and isPlayer(mostDamageKiller)) and (lastHitKiller ~= mostDamageKiller) then
doPlayerAddExp(lastHitKiller, (getPlayerExperience(cid)/200)*pvpParcent)
end
end
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) then
if isInArea(getPlayerPosition(cid), fromPosition, toPosition) then
gainExperience(cid, lastHitKiller, mostDamageKiller)
end
end
return TRUE
end
AGRADEÇO DESDE JA! :X