# Lost the 2nd arg of the random number function

**URL:** <https://forum.makecode.com/t/lost-the-2nd-arg-of-the-random-number-function/379>\
**Category:** Arcade\
**Created:** [July 29, 2019, 8:09am UTC](https://forum.makecode.com/t/lost-the-2nd-arg-of-the-random-number-function/379 "2019-07-29T08:09:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samsuanchen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/samsuanchen/32/267_2.png) [@samsuanchen](https://forum.makecode.com/u/samsuanchen)\
**Post date:** [July 29, 2019, 8:09am UTC](https://forum.makecode.com/t/lost-the-2nd-arg-of-the-random-number-function/379/1 "2019-07-29T08:09:55Z")

</div>

After checking the following JavaScript then back to blocket, I will lost each 2nd arg of the random number of my code.

`game.onUpdateInterval(3000, function () { 小蜜蜂 = sprites.createProjectileFromSprite(img`  
. . . . . . . . . . . . . . . .  
. . . . . . . . . . 5 . . . . .  
. . . . . . . 3 5 5 5 5 . . . .  
. . f . . . 5 f 5 5 5 f 3 3 . .  
. . . f . . 3 5 5 f 3 5 . . . .  
. . . . f 5 f 5 f 5 . . . . . .  
. . . . . 3 5 f 5 3 f 4 f 4 . .  
. 3 f f . 4 f f 4 4 f 5 f 4 5 .  
. 5 f 4 5 3 f f 5 4 f 4 f 3 4 .  
. 3 f f . 5 3 f 5 4 f 4 f 4 . .  
. . . . . 3 f 5 f 5 4 3 f . . .  
. . . . f . 3 5 5 f 5 5 . . . .  
. . . f . . f . 5 5 f 3 . . . .  
. . f . . . 3 f . 5 5 5 f . . .  
. . . . . . . 3 . . . . . 3 . .  
. . . . . . . . . . . . . . . .  
`, 美艷花朵, Math.randomRange(小蜜蜂隨機速度起始值, 小蜜蜂隨機速度終止值), Math.randomRange(小蜜蜂隨機速度起始值, 小蜜蜂隨機速度終止值)) if (小蜜蜂.vx > 0) { 小蜜蜂.image.flipX() } 美艷花朵.setVelocity(Math.randomRange(美艷花朵隨機速度起始值, 美艷花朵隨機速度終止值), Math.randomRange(美艷花朵隨機速度起始值, 美艷花朵隨機速度終止值)) })`

 ![lost2ndArgOfRandomfunction](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/c802be19ec01cc55ef11d62020eba4c08afa3e10.jpeg)

`game.onUpdateInterval(3000, function () { 小蜜蜂 = sprites.createProjectileFromSprite(img`  
. . . . . . . . . . . . . . . .  
. . . . . . . . . . 5 . . . . .  
. . . . . . . 3 5 5 5 5 . . . .  
. . f . . . 5 f 5 5 5 f 3 3 . .  
. . . f . . 3 5 5 f 3 5 . . . .  
. . . . f 5 f 5 f 5 . . . . . .  
. . . . . 3 5 f 5 3 f 4 f 4 . .  
. 3 f f . 4 f f 4 4 f 5 f 4 5 .  
. 5 f 4 5 3 f f 5 4 f 4 f 3 4 .  
. 3 f f . 5 3 f 5 4 f 4 f 4 . .  
. . . . . 3 f 5 f 5 4 3 f . . .  
. . . . f . 3 5 5 f 5 5 . . . .  
. . . f . . f . 5 5 f 3 . . . .  
. . f . . . 3 f . 5 5 5 f . . .  
. . . . . . . 3 . . . . . 3 . .  
. . . . . . . . . . . . . . . .  
`, 美艷花朵, Math.randomRange(小蜜蜂隨機速度起始值, 0), Math.randomRange(小蜜蜂隨機速度起始值, 0)) if (小蜜蜂.vx > 0) { 小蜜蜂.image.flipX() } 美艷花朵.setVelocity(Math.randomRange(美艷花朵隨機速度起始值, 0), Math.randomRange(美艷花朵隨機速度起始值, 0)) })`

---

<div class="post-metadata">

**Author:** ![dereklai](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dereklai/32/56_2.png) [@dereklai](https://forum.makecode.com/u/dereklai)\
**Post date:** [July 29, 2019, 11:19am UTC](https://forum.makecode.com/t/lost-the-2nd-arg-of-the-random-number-function/379/2 "2019-07-29T11:19:34Z")

</div>

It seems the Language needs to be set to English to be convertable from Javascript or PNG. randomRange and startEffect blocks have the same problem.
