Why doesn't this Roblox studio script work?
Hello, I'm learning programming and am currently working on a tycoon.
I wanted to program it so that there's money, and every second the amount is increased by one. And when you click on the cash register, the money should be added to the text label. I wrote this script:
But when I try it, nothing is added to the money. Can anyone help me?
This is a very common beginner mistake. I did it at the beginning.
You just have to do this:
So you need to use playergui instead of Startergui.
thanks to
You use a while True loop there that blocks the execution. This means the event handler for the click will never be added. You must add the event handler before the while loop.
Long-termick would make sense to solve this differently. Vllt. there is a timer that can trigger a callback.
Thanks 🙂