https://prnt.sc/1qcvxu8 Dropper script
https://prnt.sc/1qcw1rp Purchase script
I am pretty inexperienced in programming and wanted to create a really basic tycoon and had this as my dropper script. When you purchase the dropper, it moves the dropper from server storage to the "objects" model (in the tycoon) and there is an if statement checking if the model's parent is the objects model. Sometimes it works when I test it and sometimes it drops in bursts of two. (By sometimes it works and sometimes it doesn't, I mean sometimes when I test it, it always drops one and other times it will always double drop, not just sometimes it will drop two and other times it will drop one)
I tried a lot of fixes and ended up with this code since I thought the problem could be that the loop is being started more than once, so I made only one loop that runs continuously, but the bug still happens.
Also sorry if my code is messy

2 comments
Do some debugging, see if anything runs twice. It happens all the time with me, its usually a loop or a debounce with the wrong requirements
I tested by putting a print in the loop and found out that sometimes when I test it, it only prints once before stopping (probably because the dropper starts in workspace and is moved into server storage) but sometimes it just loops forever anyways and when I buy the dropper, it creates another loop... I still have no clue why this happens and why it happens seemingly randomly