Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to remove any added children to ReplicatedStorage?

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
1
Answered by 3 years ago

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.

Ad

Answer this question