Function does not work as expected

First you want to use logical || operator, not the bitwise | operator:

if roll == 7 || roll == 11

and

elseif roll == 2 || roll == 3 || roll == 12

But after this, the function

diceroll()

is not defined for me, but probably for you.

In general, consider the following:

2 Likes