Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to remove any added children to ReplicatedStorage?

Hello,

I am currently trying to make a system that automatically removes any new added remote events to ReplicatedStorage to prevent exploits. I've been looking everywhere as to how to make this but I haven't found anything. I had been originally thinking of making a loop to destroy any ChildAdded instances however I am unsure how to destroy any added instances. If I could get any help with this it would be great.

Thanks!

1 answer

✓ Accepted answer

You were right in your thinking process. To do what you want to do you can create a loop. You can do the following...

while true do
	wait(1)
		for Event, in pairs(Events) do
			if not RS:FindFirstChild(Event.Name) then
			Event:Destroy()
		end
	end
end

The above isn't perfect but it's the gist of how to do it.

This discussion is preserved as it was. New answers, comments, and votes are closed.