[2024.4] Random numbers + local variables = quirky behaviour?

Started by mebingle on

Topic category: Help with MCreator software

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[2024.4] Random numbers + local variables = quirky behaviour?

Hi all,

 

I'm running into a really strange issue, and from what I can tell it's not caused by a logic error. I'm setting up a custom GUI to act as a slot machine, however when I run my "spin" logic to set the slots to different items it's behaving in unexpected ways. See below for the "code":

 

 

Sometimes this will output numbers as high as 64, but then set the first slot to the black coin which, by the logic provided, should never be happening.

 

My best guess is that because the local variable is a number and I'm randomising an int, potentially it's being parsed as a float? Any help would be greatly appreciated.

 

 

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
  Here's an actual in-game…
Thu, 01/30/2025 - 13:41

 

Here's an actual in-game example. Everything was working as expected up until this point, and then suddenly a reelA is set to 90, but the slot is set to a black coin. Very strange.