Skip to content

Duel.CreateToken ​

Signature ​

lua
Duel.CreateToken(int player, int code) -> Card|false

Description ​

Creates a Token card with card code code for player and returns it. The returned Token is not placed on the field automatically; scripts normally pass it to Duel.SpecialSummon or another operation afterwards.

Parameters ​

  • player int
  • code int

Returns ​

  • Card|false

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 243 indexed script(s).
  • Search this function in the Script Explorer with Duel.CreateToken.
CardIDScriptDetected Calls
Surprise Fusion35167375Scripts/c35167375.lua1
Spirit Illusion71939275Scripts/c71939275.lua1
Duel Link Dragon, the Duel Dragon60025883Scripts/c60025883.lua1
Plunder Patrollship Jord85969517Scripts/c85969517.lua1
Mecha Phantom Beast Auroradon44097050Scripts/c44097050.lua1
Black Garden71645242Scripts/c71645242.lua2
Dual Avatar Invitation87669904Scripts/c87669904.lua1
Sleipnir the Runick Mane74659582Scripts/c74659582.lua1
Sleepy Scapegoats3129527Scripts/c3129527.lua1
Crystron Halqifibrax Prism65400671Scripts/c65400671.lua1
Shinobaroness Peacock25415052Scripts/c25415052.lua1
Lost World17228908Scripts/c17228908.lua1
Token Support53545926Scripts/c53545926.lua1
Dark Creator52768390Scripts/c52768390.lua1
Blackwing - Gofu the Vague Shadow9929398Scripts/c9929398.lua1
Dark Alligator34479658Scripts/c34479658.lua1
Phantasmal Lord Ultimitl Bishbaalkin90884403Scripts/c90884403.lua2
Shinobaron Peacock52900000Scripts/c52900000.lua1
Ogdoadic Daybreak78789356Scripts/c78789356.lua1
Generaider Boss Stage38053381Scripts/c38053381.lua1
Blooming of the Darkest Rose99092624Scripts/c99092624.lua1
V-LAN Hydra13536606Scripts/c13536606.lua1
Prank-Kids Pranks43664494Scripts/c43664494.lua1
Garden Rose Flora76524506Scripts/c76524506.lua1
...and 219 more

Script Examples ​

Surprise Fusion (35167375) ​

Source: Scripts/c35167375.lua

lua
			and Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0,TYPES_TOKEN_MONSTER,0,0,level,RACE_SPELLCASTER,ATTRIBUTE_DARK) then
			for i=1,2 do
				local token=Duel.CreateToken(tp,id+o)
				local e1=Effect.CreateEffect(e:GetHandler())
				e1:SetType(EFFECT_TYPE_SINGLE)

Spirit Illusion (71939275) ​

Source: Scripts/c71939275.lua

lua
	if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
		and Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0,TYPES_TOKEN_MONSTER,tc:GetAttack(),0,5,tc:GetRace(),tc:GetAttribute()) then
		local token=Duel.CreateToken(tp,id+o)
		local e1=Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)

Source: Scripts/c60025883.lua

lua
	if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)<=0
		or not Duel.IsPlayerCanSpecialSummonMonster(tp,60025884,0,TYPES_TOKEN_MONSTER,atk,def,lv,race,att) then return end
	local token=Duel.CreateToken(tp,60025884)
	Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP,zone)
	local e1=Effect.CreateEffect(c)