Tipo um exeta res?
info
Group: Campones
Joined: 10/06/13
Posts: 62
Reputation: +2

info
Group: Cavaleiro
Joined: 01/04/13
Posts: 156
Reputation: +26
Gender: Masculino
Tibia Character: Yugami

é assim o script que eu quero ao player fala Tendou ele puxa o player q esta no target
info
Group: Marquês
Joined: 02/08/12
Posts: 1k
Reputation: +234
Tibia Character: Maurolkit

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if(target > 0 then)
doTeleportThing(target, getThingPos(cid))
end
return true
end
info
Group: Campones
Joined: 09/06/13
Posts: 11
Reputation: 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
Group: Marquês
Joined: 02/08/12
Posts: 1k
Reputation: +234
Tibia Character: 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
Edited Junho 10 by Skymagnum
info
Group: Cavaleiro
Joined: 01/04/13
Posts: 156
Reputation: +26
Gender: Masculino
Tibia Character: 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
Edited Junho 10 by Tiagone
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino

if(target > 0 then)
sky isso nao eh C++
if isCreature(target) then
info
Group: Marquês
Joined: 02/08/12
Posts: 1k
Reputation: +234
Tibia Character: Maurolkit

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if(target > 0) then
doTeleportThing(target, getThingPos(cid))
end
return true
end
info
Group: Cavaleiro
Joined: 01/04/13
Posts: 156
Reputation: +26
Gender: Masculino
Tibia Character: Yugami

Funfou Certinho Podem Fecha o Topico e Rep+ pra tu Sky tem como ajuda em otra magia que , Atinge Direto No Mana?
Edited Junho 10 by Tiagone
info
Group: Campones
Joined: 09/06/13
Posts: 11
Reputation: 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>
Edited Junho 10 by znotewebsite
adiciona isso:
if not target then return not doPlayerSendCancel(cid, "You need a target.") end
embaixo de:
local target = getCreatureTarget(cid)
info
Group: Marquês
Joined: 02/08/12
Posts: 1k
Reputation: +234
Tibia Character: 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
Group: Campones
Joined: 09/06/13
Posts: 11
Reputation: 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
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: 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
Edited Junho 11 by Slicer





info
Group: Cavaleiro
Joined: 01/04/13
Posts: 156
Reputation: +26
Gender: Masculino
Tibia Character: 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