Ai Pessoal Queria Sabe Como Que Fais Um Spells Que Puxa o Target Se Puderem Ajuda Rep+ Pra Quem Ajuda e o Server é 854
Tipo um exeta res?
é assim o script que eu quero ao player fala Tendou ele puxa o player q esta no target
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?
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
if(target > 0 then)
sky isso nao eh C++
if isCreature(target) then
"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬
"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein
Funfou Certinho Podem Fecha o Topico e Rep+ pra tu Sky tem como ajuda em otra magia que , Atinge Direto No Mana?
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>
adiciona isso:
if not target then return not doPlayerSendCancel(cid, "You need a target.") end
embaixo de:
local target = getCreatureTarget(cid)

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
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
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
"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬
"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein