Trying to detect if BodyGyro has been added to Character

I’ve been trying to detect if BodyGyro has been added to player model for security issues, however it does not seem to work any idea on why it isn’t detecting it?
Script is server-sided.

local HRP = Character:FindFirstChild("HumanoidRootPart")
		HRP.ChildAdded:Connect(function(Inst)
		    if Inst:IsA("BodyGyro") --[[and not (Inst.Name == "HDAdminFlyGyro")--]] then
				print("Added: "..Inst.Name)
			end
		end)

Server scripts can’t detect when things are added on the client, you’re going to have to put this in a LocalScript.

Also this isn’t very secure, but it will probably fend off some exploiters.

2 Likes

Would it work if the player was inserting a BodyGyro on the client?

It’s just a very basic anti-fly exploit. I guess i could try to make it localscript.
It’ll only fend some users using FE ADMIN guis and not special guis that bypass localscripts anti-cheats.

1 Like

It’s more about explorers, not GUIs, you can give it a try nonetheless, perhaps add it as part of a more important LocalScript, further making the exploit barrier higher.

That’s what i did, i put the anti-exploit on a localscript that handles every single remote event, if it’s ever tampered with the game becomes unplayable.
I also used a cruel punishment (making the screen bright and a looping sound) instead of kick because i know it’s bypassable.