How do I use Instance.AncestryChanged?

Hello :smiley:

  1. What do you want to achieve?
    I want to move a proyectile script into a part, and execute it when the script is moved to the part.

  2. What is the issue?
    AncestryChanged doesn’t seem to send a signal when I move the script.

  3. What solutions have you tried so far?
    I’ve tried waiting for a trigger, like changing a property of something, and when it changes the script would execute, but it doesn’t work.

The Code:

print("ejecuta") -- Showing the script does actually execute.
script.AncestryChanged:Connect(function() -- Waiting for parent change.
print("sirve") -- Print it workds.

I’m moving the script from a table in the workspace, with table.remove, and moving it into a part.

Please tell me what I’m doing wrong. Thanks!

I mean you don’t end it with end) so that could be an issue.

Thanks, i figured out the Issue!