Atleast that’s what I think it happens.
So I have this room generation system, and for some reason when I get to a “special room” (room that will be forced to load at that room number) a room gets deleted. I tried connecting an AncestryChanged event to it but it DOES NOT FIRE. So this is a code in ServerScriptService:
workspace.Rooms.ChildAdded:Connect(function(child)
warn(child.Name)
child.AncestryChanged:Connect(function(child,parent)
print(parent)
end)
end)
Normal behaviour of the above script:
warn
“warns” the Room name (e.g. Room26)
print
prints the Parent (workspace.Rooms)
print
might print nil
when a room gets destroyed, for performance
Odd behaviour:
print
doesn’t print, the room still gets Thanos snapped
You might think the room gets deleted on the client and the server doesn’t see it, but it’s deleted there aswell. AFAIK nothing is trying to delete the room.
I would provide a video of what’s happening but it’s very laggy.
I’m losing my mind over this, what should I do???
1 Like
show the video then ------------
1 Like
show the video, its recommended even if it’s laggy lol
@RonClon_TM, @FrostedTamim, sorry for the 1 hour minute delay. I was trying to fix the bug, still no solution, or even an idea why it happens. The video compressing process took a while since the video is big and laggy.
Here is the video, you can see in the explorer (at the end) that it jumps from a number to another with the middle one missing. That’s the one getting deleted.
Hope you can make out something:
is room disapear momentally?
is room 37 a end of chase?
Room37 was deleted for ever. No, all of those rooms are “special”. Didn’t get to the end.
try to use Find all

destroy, remove, room, etc.
When you destroy objects, their events are disconnected automatically. Instead of AncestryChanged, I recommend ChildRemoved when working with objects that may be deleted.
Already tried all of those, no luck. In the GenerationModule it doesn’t seem like it deletes the room using the function it should, no other references of destruction in there.
Interestingly enough, I already tried that. Same result, didn’t print anything. Meaning it didn’t fire. I should mention the script with the connection is not inside the deleted model.
You used workspace.Rooms.ChildRemoved:Connect(function(child)?
That should work because it’s not an event of Room37.
Yes, in the script provided at the top, there was below all that your ChildRemoved event, which acts basically the same as in the current script.
Alternatively you can use the Instance.Destroying
method to check if something is destroyed.
1 Like
Hey, sorry for the delay. That doesn’t work either. Here is the schema:
Room34 (monster spawn room)
Room29 has been destroyed. (using .Destroying)
Room35 (long pipe and stuff room)
Room30 has been destroyed.
Room36 (faulty room)
--but no Room36 has been destroyed. (It did get deleted)
What is happening?
That’s probably not a bug. It’s likely you have done something wrong in your code (such as creating the connection after the room is created).
How else am I supposed to connect it? The script provided at the top is a standalone script, has nothing to do with the GenerationModule. I think I know the issue, if not, I will need to change how I create those rooms. Yikes.