I have a group object that is stored in ReplicatedStorage, I’d like the events to happen when the AncestoryChanged
event is triggered. I’d like the event to trigger when the grouped object has been parented to the workspace, I have my code here and it won’t run, the object is parented to the workspace but the code isn’t running and it is very confusing. Here are my 2 attempt codes that yielded no result.
Attempt 1:
local main = script.Parent
main.AncestryChanged:Connect(function(child: Instance, parent: Instance)
if parent == game.Workspace then
print("Hello world")
end
end)
Attempt 2:
local main = script.Parent
main.AncestryChanged:Connect(function(child: Instance, parent: Instance)
if child == main then
print("Checkpoint 1 Conf")
if parent == game.Workspace then
print("Checkpoint 2 Conf")
end
end
end)
Both results, the code in the event has never triggered.