I’m trying to make a script that removes remote events from ReplicatedStorage to stop backdoor scripts from making new RemoteEvents and firing them, but I don’t know of a way to find them when I don’t have a specific name for the RemoteEvent.
1 Like
Just use ChildAdded event.
game.ReplicationStorage.ChildAdded:Connect(function(Child)
--code
end)
I am sure you can figure out your way from here.
1 Like
You would loop through all the descendants of replicatestrorage, and use :IsA()
for _, v in pairs(game.ReplicatedStorage:GetDescendants()) do
if v:IsA("RemoteEvent") then
print(v.Name.." is a remote event.") -- do what you need to do
end
end
1 Like
What i mean i wanted to know how to check what object it is, like if its a folder, a part, a RemoteEvent?
The child parameter gives you the Instance.
So you can use any properties of Instances, for example, Child.ClassName will tell you whether it’s a remote event or not. And Child.Name will give you the name
Well, it’s correct, but exploiter can add a Instance when the game is running.
Yea in that case you would use a descendant added event.
1 Like