Ir para conteúdo
  • 0

Treiner


brendoonh

Pergunta

Bom dia Xtibianos..

 

Gostaria de saber se alguém poderia me disponibilizar uma script de treiner, na qual o treiner so aparece quando pisa no sqm.

 

Treiner aparece quando pisa no sqm

Treiner some quando sai do sqm

Treiner some caso o cara exita no sqm q aparece o treiner. (pois vi um script q o treine ficava la qnd exitava)

 

Seria possivel?

 

Obg , valendo rep+ pela colaboração.


up


up

Editado por brendoonh
Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

Um chão que ao pisar sumida um npc que no caso seria os treiner e ao sair desse piso os mesmos desapareceria. Vou entrar PC e fazer

 

Ah Blz, vou tentar fazer aqui

Link para o comentário
Compartilhar em outros sites

  • 0

Explica melhor ?

Bom, é assim...

 

O player ao ir treinar iria pisar em 1 tile, e esse tile, criaria um treiner. Isso seria uma moviments, eu acho..

 

Quando o player saísse desse tile, o treiner sumiria.

 

Caso o player dê exit encima desse treiner, assim que o char deslogar o treiner sumiria também..

 

Deu pra entender?

 

Seria assim o treiner... Veja a Imagem!

 

15hfwd5.jpg

 

Vermelho = onde o player iria pisar

Verde = onde o treiner iria aparecer.

 

OBS: O treiner teria que aparecer sempre na diagonal, pois nem todos os treiners seria que nem na imagem, so iria mudar a posição do treiner.

 

Link para o comentário
Compartilhar em outros sites

  • 0

Bom dia Xtibianos..

 

Gostaria de saber se alguém poderia me disponibilizar uma script de treiner, na qual o treiner so aparece quando pisa no sqm.

 

Treiner aparece quando pisa no sqm

Treiner some quando sai do sqm

Treiner some caso o cara exita no sqm q aparece o treiner. (pois vi um script q o treine ficava la qnd exitava)

 

Seria possivel?

 

Obg , valendo rep+ pela colaboração.

up

up

pos = {x = X, y = Y, z = Z} -- XYZ do NPC
nome = "" -- Nome do NPC

function onStepIn(cid, position)
doCreateNpc(nome, pos)
end


function onStepOut(cid, position)

rd = getTopCreature(pos)

if rd > 0 then
    doRemoveCreature(rd)
end

Deve dar certo

Link para o comentário
Compartilhar em outros sites

  • 0
pos = {x = X, y = Y, z = Z} -- XYZ do NPC
nome = "" -- Nome do NPC

function onStepIn(cid, position)
doCreateNpc(nome, pos)
end


function onStepOut(cid, position)

rd = getTopCreature(pos)

if rd > 0 then
    doRemoveCreature(rd)
end

Deve dar certo

 

Mais no caso desse, eu iria ter que fazer varios e varios scripts, pois tem 100 cabines para por os treiners '-'

 

Se tiver como modificar essa script, pois ela ta funfando quase perfeitamente, porém, ela n reconhece quando o player da exit, ao deslogar o char o treiner fica lá.. Queria arrumar só isso nesse script, consegue?

 

Script::::


function onStepIn(cid, item, position, fromPosition)
local colocar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19446] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253},
[19447] = {x = getCreaturePosition(cid).x-1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = colocar[item.actionid]
local get = getThingfromPos(e)
if get.itemid < 1 then
addEvent(doCreateMonster,1*1-1,"Training Monk", e)
doSendMagicEffect(e, CONST_ME_TELEPORT)
end
return true
end
function onStepOut(cid, item, position, fromPosition)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
end
return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

 

Mais no caso desse, eu iria ter que fazer varios e varios scripts, pois tem 100 cabines para por os treiners '-'

 

Se tiver como modificar essa script, pois ela ta funfando quase perfeitamente, porém, ela n reconhece quando o player da exit, ao deslogar o char o treiner fica lá.. Queria arrumar só isso nesse script, consegue?

 

Script::::


function onStepIn(cid, item, position, fromPosition)
local colocar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19446] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253},
[19447] = {x = getCreaturePosition(cid).x-1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = colocar[item.actionid]
local get = getThingfromPos(e)
if get.itemid < 1 then
addEvent(doCreateMonster,1*1-1,"Training Monk", e)
doSendMagicEffect(e, CONST_ME_TELEPORT)
end
return true
end
function onStepOut(cid, item, position, fromPosition)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
end
return true
end

 

 

Tenta:

function onStepIn(cid, item, position, fromPosition)
local colocar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19446] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253},
[19447] = {x = getCreaturePosition(cid).x-1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = colocar[item.actionid]
local get = getThingfromPos(e)
if get.itemid < 1 then
addEvent(doCreateMonster,1*1-1,"Training Monk", e)
doSendMagicEffect(e, CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 5665454,1)
end
return true
function onLogout(cid)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if getCreatureStorage(cid, 5665454) == 0 then
else
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
end
return true
end
end
end
function onStepOut(cid, item, position, fromPosition)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
setPlayerStorageValue(cid, 5665454,0)
end
return true
end
Editado por Danny0
Link para o comentário
Compartilhar em outros sites

  • 0

 

 

 

Tenta:

function onStepIn(cid, item, position, fromPosition)
local colocar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19446] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253},
[19447] = {x = getCreaturePosition(cid).x-1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = colocar[item.actionid]
local get = getThingfromPos(e)
if get.itemid < 1 then
addEvent(doCreateMonster,1*1-1,"Training Monk", e)
doSendMagicEffect(e, CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 5665454,1)
end
return true
function onLogout(cid)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if getCreatureStorage(cid, 5665454) == 0 then
else
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
end
return true
end
end
end
function onStepOut(cid, item, position, fromPosition)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
setPlayerStorageValue(cid, 5665454,0)
end
return true
end

250je6p.png

 

Script continua a mesma coisa... Só qe agora com esse erro na distro.

Link para o comentário
Compartilhar em outros sites

  • 0

250je6p.png

 

Script continua a mesma coisa... Só qe agora com esse erro na distro.

function onStepIn(cid, item, position, fromPosition)
local colocar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19446] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253},
[19447] = {x = getCreaturePosition(cid).x-1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = colocar[item.actionid]
local get = getThingfromPos(e)
if get.itemid < 1 then
addEvent(doCreateMonster,1*1-1,"Training Monk", e)
doSendMagicEffect(e, CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 5665454,1)
end
return true
end
function onLogout(cid)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if getCreatureStorage(cid, 5665454) == 0 then
else
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
end
return true
end
end
function onStepOut(cid, item, position, fromPosition)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
setPlayerStorageValue(cid, 5665454,0)
end
return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

Quando o player dá exit e consequentimente desloga o treiner continua lá, era pra ele sumir .

Aqui funfa normal só quando ele sai andando do tile, qnd ele exit n funfa de sumir o treiner...

Link para o comentário
Compartilhar em outros sites

  • 0

Quando o player dá exit e consequentimente desloga o treiner continua lá, era pra ele sumir .

Aqui funfa normal só quando ele sai andando do tile, qnd ele exit n funfa de sumir o treiner...

 

 

Um minuto.

Em Movements:

function onStepIn(cid, item, position, fromPosition)
local colocar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19446] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253},
[19447] = {x = getCreaturePosition(cid).x-1, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253},
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = colocar[item.actionid]
local get = getThingfromPos(e)
if get.itemid < 1 then
addEvent(doCreateMonster,1*1-1,"Training Monk", e)
doSendMagicEffect(e, CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 5665454,1)
end
return true
end
function onStepOut(cid, item, position, fromPosition)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
setPlayerStorageValue(cid, 5665454,0)
end
return true
end

Em Creaturescripts:

function onLogout(cid)
local retirar = {
[19445] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z, stackpos = 253}, -- frente /\
[19446] = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z, stackpos = 253}, -- direita
[19447] = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z, stackpos = 253}, -- tras
[19448] = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z, stackpos = 253}
}
local e = retirar[item.actionid]
local remove= getThingfromPos(e)
if getCreatureStorage(cid, 5665454) == 0 then
else
if remove.itemid > -0 then
doSendMagicEffect(e, CONST_ME_POFF)
doRemoveCreature(getThingfromPos(e).uid)
end
return true
end
end

Tag creaturescripts:

	<event type="logout" name="LogoutTrainer" event="script" value="arquivo.lua"/>

Em login.lua (creaturescripts/script), Põe perto das parecidas:

	registerCreatureEvent(cid, "LogoutTrainer")
Link para o comentário
Compartilhar em outros sites

  • 0

66w0hz.jpg

 

 

Tô sem servidor aqui para testar...

mas tenta:

function onLogout(cid, position)
F = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y-2, z = getCreaturePosition(cid).z} -- frente /\
D = {x = getCreaturePosition(cid).x+2, y = getCreaturePosition(cid).y+1, z = getCreaturePosition(cid).z} -- direita
E = {x = getCreaturePosition(cid).x+1, y = getCreaturePosition(cid).y+2, z = getCreaturePosition(cid).z} -- direita
T = {x = getCreaturePosition(cid).x-2, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z} -- tras

doRemoveCreature(getThingfromPos(F).uid)
doRemoveCreature(getThingfromPos(D).uid)
doRemoveCreature(getThingfromPos(E).uid)
doRemoveCreature(getThingfromPos(T).uid)
end
Editado por Danny0
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...