Part won't stop spamming

My name is Ted. I want this for loop to stop, and I’ve been thinking about how but came to a dead end.

I want it to stop doing what it’s doing (it’s spamming the clone of a part which is being parented to another model, but it’s being spammed and that’s because it’s inside of runservice.Heartbeat. But I thought I could use “break” to break this entirely, although thinking about it now that just does not make sense at all, because it’s always going to run because RunService.Heartbeat. I thought maybe I could add a check above it, an if statement, to check if v already has a child named Prompt. I didn’t even bother testing it after I added it because I realized it would not work, the second if statement would run regardless because that check does nothing to help what I am trying to do, it will still spam clone the part.

So I came here for help. Does anyone have any ideas?

Attached Video

uh try putting the Heartbeat into a function and call it whatever
then, run it right after you’ve made the function
then write this code where you want it to stop

[NAME OF FUNCTION]:Disconnect()
1 Like

remove the heartbeat connection, since heartbeats run forever basically unless you disconnect. another method is removing it, is that you disconnect the event, though this would cause problems.

2 Likes

i would like to ask what kinds of problems Disconnect causes, since i’ve been using it forever

Lol. Thanks. I don’t know why I thought I needed the heartbeat event but thanks.

how will you be able to detect if this happened or should I say when it triggers, how to trigger it again?

1 Like