I’m trying to make a system that randomly generates two numbers, and the player must determine which number is bigger or smaller. I use math.random to determine whether the question would be whether the comparison would determine if both numbers are bigger or smaller. Each time I solve a question, and choose the prompt to solve it again, when I’d press the button (the button that I’m having trouble with) it would trigger the event an additional time. (5 trials = 5 prints)
I haven’t found an error like this on DevForums, however I may have missed something. If anyone requires the full script, I can surely post it here.
Try MouseButton1Click instead of MouseButton1Down.
Alternatively MouseButton1Up might fix this too.
Other than that I can only assume that either your Gui handler script has 2 copies or your mouse is mechanical and is sending 2 mouse clicks.
I have debounce on the button, so more than 1 mouse click at a time shouldn’t be the problem. I tried MouseButton1Click, and MouseButton1Up, however they didn’t work.
My problem isn’t with figuring out how to determine which of two values is bigger, my problem is that when I press the button it triggers an additional time it’s pressed. For example with your code, line 5 would repeat an additional time giving me a different number each time.