Tipo um exeta res?
info
Grupo: Campones
Registrado: 10/06/13
Posts: 62
Reputação: +2

info
Grupo: Cavaleiro
Registrado: 01/04/13
Posts: 156
Reputação: +26
Gênero: Masculino
Char no Tibia: Yugami

é assim o script que eu quero ao player fala Tendou ele puxa o player q esta no target
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if(target > 0 then)
doTeleportThing(target, getThingPos(cid))
end
return true
end
info
Grupo: Campones
Registrado: 09/06/13
Posts: 11
Reputação: 0

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if(target > 0 then)
doTeleportThing(target, getThingPos(cid))
end
return true
end
Teria como fazer uma que o player troca-se de lugar com o target?
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z}
if(target > 0) then
doTeleportThing(target, getThingPos(cid))
doTeleportThing(cid, tPos)
end
return true
end
Editado Junho 10 por Skymagnum
info
Grupo: Cavaleiro
Registrado: 01/04/13
Posts: 156
Reputação: +26
Gênero: Masculino
Char no Tibia: Yugami

cara aki deu erro :C tem como ajuda?
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if(target > 0 then)
doTeleportThing(target, getThingPos(cid))
end
return true
end
Editado Junho 10 por Tiagone
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

if(target > 0 then)
sky isso nao eh C++
if isCreature(target) then
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if(target > 0) then
doTeleportThing(target, getThingPos(cid))
end
return true
end
info
Grupo: Cavaleiro
Registrado: 01/04/13
Posts: 156
Reputação: +26
Gênero: Masculino
Char no Tibia: Yugami

Funfou Certinho Podem Fecha o Topico e Rep+ pra tu Sky tem como ajuda em otra magia que , Atinge Direto No Mana?
Editado Junho 10 por Tiagone
info
Grupo: Campones
Registrado: 09/06/13
Posts: 11
Reputação: 0

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z}
if(target > 0) then
doTeleportThing(target, getThingPos(cid))
doTeleportThing(cid, tPos)
end
return true
end
MAN merece 3 reps ![]()
Mas tem como qnd trocar o player ficar com 10% de life e 10% de mana? Pq se n fica mt roubado só gastar mana pra trocar de lugar da pra trapar os outros fazer varias coisas :S (add aqui nos favoritos amanha te do teus reps)
EDIT:
Usei varias vezes e crashou o servidor =(
apareceu esses erros
[Error - Spell Interface]
data/spells/scripts/changeposition.lua:onCastSpell
Description:
<luaGetThingPosition> Thing not found
[Error - Spell Interface]
data/spells/scripts/changeposition.lua:onCastSpell
data/spells/scripts/changeposition.lua:4: attempt to index a boolean value
stack traceback
data/spells/scripts/changeposition.lua:4: in function <data/spells/scripts/changeposition.lua:1>
Editado Junho 10 por znotewebsite
adiciona isso:
if not target then return not doPlayerSendCancel(cid, "You need a target.") end
embaixo de:
local target = getCreatureTarget(cid)
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

Nem manjo das matematica mas acho q da certo.
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if not target then
return not doPlayerSendCancel(cid, "You need a target.")
end
local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z}
local hp = getCreatureHealth(cid) * 10 / 100
local mana = getCreatureMana(cid) * 10 / 100
doTeleportThing(target, getThingPos(cid))
doTeleportThing(cid, tPos)
doCreatureAddHealth(cid, - getCreatureHealth(cid) - hp)
doCreatureAddMana(cid, - getCreatureMana(cid) - mana)
return true
end
info
Grupo: Campones
Registrado: 09/06/13
Posts: 11
Reputação: 0

Nem manjo das matematica mas acho q da certo.
function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not target then return not doPlayerSendCancel(cid, "You need a target.") end local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} local hp = getCreatureHealth(cid) * 10 / 100 local mana = getCreatureMana(cid) * 10 / 100 doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) doCreatureAddHealth(cid, - getCreatureHealth(cid) - hp) doCreatureAddMana(cid, - getCreatureMana(cid) - mana) return true end
Se eu usar a magia sem ter nenhum target da o mesmo erro antigo!
E quando eu uso até funciona, só que quando eu troco de posição eu morro por Mana Drain :S
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if not isCreature(target) then
doPlayerSendCancel(cid, "You need a target.")
return true
end
local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z}
local hp = getCreatureMaxHealth(cid) / 100 * 10
local mana = getCreatureMaxMana(cid) / 100 * 10
doTeleportThing(target, getThingPos(cid))
doTeleportThing(cid, tPos)
doCreatureAddHealth(cid, - hp)
doCreatureAddMana(cid, - mana)
return true
end
Editado Junho 11 por Slicer





info
Grupo: Cavaleiro
Registrado: 01/04/13
Posts: 156
Reputação: +26
Gênero: Masculino
Char no Tibia: Yugami
Ai Pessoal Queria Sabe Como Que Fais Um Spells Que Puxa o Target Se Puderem Ajuda Rep+ Pra Quem Ajuda e o Server é 854