Hello! I'm a beginner scripter so don't expect me to know a lot. In my game,there's a part where when you hover over it once, it spawns 1 part. I'm trying to make a textlabel where when a part spawns, it says 1 and goes up by 1 whenever 1 part is spawned. I put the parent of the parts that are going to spawn to part3. The goal for the game is in a certain amount of time, the player has to hover over the block repeatedly until it reaches 150 parts. Here's the code for the textlabel:
local text = game.StarterGui.ScreenGui.TextLabel.Text
text = "0"
repeat
if game.Workspace.part3.ChildAdded then
local newtext = text + 1
text = newtext
wait(5)
end
until text == "150"
I tried to do GetChildren() and a function but no luck. Any help would be appreciated!

2 comments
Doesn't seem to be working. I tried changing up the code as well but no luck. Do you want to see the code for creating the new parts?
yea