Skip to content

Duel.GetAttackTarget ​

Signature ​

lua
Duel.GetAttackTarget() -> Card

Description ​

Returns the monster currently being attacked, or nil for a direct attack.

Returns ​

  • Card

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:4958

Guided Examples ​

Learn how to use this function in context:

Used By ​

Generated from the local Scripts/ folder and cards.cdb.

  • Detected in 659 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetAttackTarget.
CardIDScriptDetected Calls
Trirealm Rift Judgment65195679Scripts/c65195679.lua1
K9-X Forced Release53792930Scripts/c53792930.lua1
Number 99: Utopia Dragonar95134948Scripts/c95134948.lua1
Number 38: Hope Harbinger Dragon Titanic Galaxy63767246Scripts/c63767246.lua1
All-Eyes Phantom Dragon70335319Scripts/c70335319.lua1
Darkuriboh1035143Scripts/c1035143.lua2
Genex Ally Triforce52709508Scripts/c52709508.lua1
Gladiator Beast Gaiodiaz90957527Scripts/c90957527.lua1
Magnet Warrior Sigma Minus87814728Scripts/c87814728.lua1
Megaroid City44139064Scripts/c44139064.lua2
Borrelcode Dragon67288539Scripts/c67288539.lua1
Salamangreat Sanctuary1295111Scripts/c1295111.lua1
Shura the Combat Star32615065Scripts/c32615065.lua2
Cubic Rebirth71442223Scripts/c71442223.lua1
Witchcrafter Madame Verre21522601Scripts/c21522601.lua4
X-Saber Gottoms8252010Scripts/c8252010.lua1
Mementomictlan43338320Scripts/c43338320.lua1
K9-LC Release Restraint27308231Scripts/c27308231.lua1
Red Cocoon2542230Scripts/c2542230.lua1
Performage Ball Balancer92530005Scripts/c92530005.lua1
Infernoid Piaty25811989Scripts/c25811989.lua1
Raidraptor - Last Strix97219708Scripts/c97219708.lua1
Mechanical Mechanic22106558Scripts/c22106558.lua2
White Knight Lord14732294Scripts/c14732294.lua1
...and 635 more

Script Examples ​

Trirealm Rift Judgment (65195679) ​

Source: Scripts/c65195679.lua

lua
	if Duel.GetMatchingGroupCount(aux.TRUE,e:GetHandlerPlayer(),LOCATION_DECK,0,nil)>0 then return end
	local a=Duel.GetAttacker()
	local d=Duel.GetAttackTarget()
	if not d then return false end
	if not a:IsControler(tp) then a,d=d,a end

K9-X Forced Release (53792930) ​

Source: Scripts/c53792930.lua

lua
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
	local at=Duel.GetAttackTarget()
	local ar=Duel.GetAttacker()
	if at and at:IsSetCard(0x1cb) then

Number 99: Utopia Dragonar (95134948) ​

Source: Scripts/c95134948.lua

lua
	local tc=eg:GetFirst()
	local p=tc:GetControler()
	if Duel.GetAttackTarget()~=nil then return end
	if tc:GetFlagEffect(95134948)==0 then
		tc:RegisterFlagEffect(95134948,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)