Recently, my game was being exploited several times using this script
local Plr = game:GetService("Players").LocalPlayer
local Moude = Plr:GetMouse()
Mouse.Button1Down:connect(function()
if not game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftControl) then
return
end
if not Mouse.Target then
return
end
Mouse.Target:Destroy()
end)
I was wondering if there's an actual way to counter this problem.
Thanks.

12 comments
Just a question, but is it the code block editor that put that all on one line or did you do that intentionally? Looking at the source it looks as though you wrote all your code on one line.
Oh, I'm sorry. I didn't do that intentionally. Let me fix it
Ok as for the code, are you sure this script specifically was being exploited, and exploits are almost always targetted at the client itself which is up to roblox to fix. There's not much you can do except maybe have a script that makes sure the players are behaving normally.
like adding checks if parts exist in the client?
It shouldn't even be exploited because if you look on line 2, Mouse isn't even spelt correctly, but they use it further in the script, also. Please explain to me what the script does.
:Connect() pls
Since FilteringEnabled exists, the hacker will only ruin it for themself. You shouldn't really be worrying about them.
serverside noclip checking by getting parts around the player and checking if they're inside the part using a distance formula for said part.
Obviously, just delete either Mouse.Target:Destroy() or delete the whole script itself.
No ^
You can't do that. The script is injected via a dynamic-link library (DLL) that the exploit uses to run its scripts. The scripts of an exploit run in the game but can't necessarily be found in-game.
As far as I know it doesn't need to be injected using a DLL and that any executable will do.