I’m currently taking on a task to prevent exploiters but I’ve ran into a problem. What I want to do is check if part is inserted but unfortunately I don’t know how to do that. I also feel like this is impossible but let’s see.
Here’s my script I tried:
game.Players.PlayerAdded:Connect(function()
local insertedscript = Instance.new("Script")
if insertedscript then
insertedscript:Destroy()
end
end)
I hope this is possible though so I can achieve this.
To check if something is added though you can use this:
game.Workspace(or whatever the parent is).ChildAdded:Connect(function()
If you would like you can put in the parentheses after function a value to use as the thing added.
To check if an Instance is added to something, you can use Child Added.
However, you can’t detect when exploiters use a script as it doesn’t have to be an Instance and it really never is. Even if you use ChildAdded on the client to detect a specific exploit, for example, you would still have to compare it to the server and make sure it was on the client only. Anything you do to prevent exploiting on the client can be bypassed.
You can’t really use this to prevent exploits, you’d need to just make your script’s secure and make sure you don’t have any backdoors which can give player’s access to the server.
Wait, I thought this would prevent exploiters from instancing scripts(if you basically detect for every services) and remote events and local scripts right?
game.Players.PlayerAdded:Connect(function()
game.Workspace.ChildAdded:Connect(function(child)
if child:IsA("Script") then
child:Destroy()
end
end)
end)
They don’t have to create a script to execute code, they don’t have to insert anything as an Instance, therefore, it’s practically impossible to stop exploiters running code. The most you can do is protect your RemoteEvents with proper server-side checks and make server-side anti-cheat, e.g. flying. Even then, it can still be spoofed.
The server cannot detect if exploiters inserts an object/instance, since it does not replicate to the server from the client.
Exploiters run their code on the client-side, which means the classname would be LocalScript, not Script (not that it really matters in this scenario, as it’s a lost case).
am pretty sure its not possible if its added thru the client because you wont be able to detect it that would only run in the server so if you had a backdoor spamming audios you can delete it etc.