Skip to content

Duel.TossDice ​

Signature ​

lua
Duel.TossDice(int player, int count1, [int count2]) -> int,...?

Description ​

Tosses count1 dice for player and, when count2 is supplied, count2 dice for the opponent. Valid dice results are integers from 1 to 6. Normal script use should keep count1 + count2 at 5 or less; the core rejects count1 <= 0 and count2 < 0.

Parameters ​

  • player int
  • count1 int
  • count2 int optional - default: 0

Returns ​

  • int - First die result.
  • ...? - Additional die results.

Source ​

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

Used By ​

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

  • Detected in 61 indexed script(s).
  • Search this function in the Script Explorer with Duel.TossDice.
CardIDScriptDetected Calls
Masterking Archfiend35606858Scripts/c35606858.lua1
Reversal Box2606417Scripts/c2606417.lua1
Hi-Speedroid Clear Wing Rider86154370Scripts/c86154370.lua1
Re-dyce-cle85704698Scripts/c85704698.lua1
Time Magic Hammer10960419Scripts/c10960419.lua1
Astra Ghouls69170403Scripts/c69170403.lua1
Evil Lord - Zorc73320394Scripts/c73320394.lua1
Shateki5574510Scripts/c5574510.lua1
Vaylantz Mad Marquess87897777Scripts/c87897777.lua2
Graceful & Skull Dice76630812Scripts/c76630812.lua2
Morphtronic Smartfon15521027Scripts/c15521027.lua2
Desrook Archfiend72192100Scripts/c72192100.lua1
Thunder Ball84813516Scripts/c84813516.lua1
Morphtronic Telefon38082437Scripts/c38082437.lua2
Speedroid Wheel12148078Scripts/c12148078.lua1
Terrorking Archfiend35975813Scripts/c35975813.lua1
Number 7: Lucky Straight82308875Scripts/c82308875.lua1
Infernalqueen Archfiend8581705Scripts/c8581705.lua1
Number 67: Pair-a-Dice Smasher35772782Scripts/c35772782.lua1
First Striker Advantage58995660Scripts/c58995660.lua1
Musical Sumo Dice Games96637156Scripts/c96637156.lua1
Number 85: Crazy Box42421606Scripts/c42421606.lua1
Roulette Spider36708764Scripts/c36708764.lua1
Dice Dungeon11808215Scripts/c11808215.lua1
...and 37 more

Script Examples ​

Masterking Archfiend (35606858) ​

Source: Scripts/c35606858.lua

lua
end
function c35606858.dcop(e,tp,eg,ep,ev,re,r,rp)
	local d=Duel.TossDice(tp,1)
	local g=eg:Filter(aux.NecroValleyFilter(c35606858.cfilter),nil,e,tp)
	if g:GetCount()==0 then return end

Reversal Box (2606417) ​

Source: Scripts/c2606417.lua

lua
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local ct=Duel.TossDice(tp,1)
	if c:GetCounter(0x76)+ct>6 then ct=6-c:GetCounter(0x76) end
	if ct>0 then

Hi-Speedroid Clear Wing Rider (86154370) ​

Source: Scripts/c86154370.lua

lua
function c86154370.desop(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local dc=Duel.TossDice(tp,1)
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
	local gy=Duel.SelectMatchingCard(tp,c86154370.gyfilter,tp,LOCATION_GRAVE,0,1,dc,nil)