Module:Dice/Format: Difference between revisions

194 bytes added ,  14:10, 31 July 2019
set template = (title) to specify a template
(use expandTemplate)
(set template = (title) to specify a template)
Line 5: Line 5:
function DiceStats.diceStats(frame)
function DiceStats.diceStats(frame)
     local dice = Dice.fromString(frame.args.roll)
     local dice = Dice.fromString(frame.args.roll)
    if (frame.args.template ~= nil or frame.args.template ~= '') then
        local templatetitle = frame.args.template
    else
        local templatetitle = 'DiceStats'
    end
     return frame:expandTemplate{
     return frame:expandTemplate{
         title = 'DiceStats',
          
            title = templatetitle,
         args = {
         args = {
             minimum = dice:minimum(),
             minimum = dice:minimum(),