Exploiters abusing SimulationRadius and flinging players using unanchored parts

Before i say anything, yes i checked all of the “similiar” posts i couldn’t find any that seemed to help me…

So i made a nds modded game for fun, it ended up getting 70+ ccu which is yk pretty cool
Rn i ran into a problem with stuff, exploiters are using “Ring Parts” to fling players and collect unanchored parts to fling others

My attempt to fix it was to loop thru all parts and reset the NetworkOwner, this seems to not work properly though

Script:

local structure = workspace:WaitForChild("Structure")

local function resetNetOwner(child)
	if child.Anchored ~= false then
		return
	end
	
	pcall(function()
		if child.Anchored == true then
			return
		end
		
		local netOwner = child:GetNetworkOwner()

		if netOwner ~= nil then
			child:SetNetworkOwner(nil)
		end
	end)
end

structure.DescendantAdded:Connect(function(descendant : BasePart)
	if descendant:IsA("BasePart") then
		resetNetOwner(descendant)
	end
end)

game["Run Service"].Heartbeat:Connect(function()
	for indx, player in pairs(game.Players:GetPlayers()) do
		player.ReplicationFocus = nil
	end
end)

while true do
	for index, descendant in pairs(structure:GetDescendants()) do
		if descendant:IsA("BasePart") then
			resetNetOwner(descendant)
		end
	end
	
	task.wait(5)
end

Exploiters are still flinging stuff around and i just can’t get to fix it…
Now i also know that we shouldn’t trust client with handling security stuff but i still tried one last thing and that is making a localscript to auto delete BodyPos instances but that seems to not work also

game.DescendantAdded:Connect(function(p)
	if p:IsA("BodyPosition") then
		p:Destroy()
	end
end)

Ikr mad chaos

2 Likes

Hi @ThtRookie

Its not perfect,in some cases there will be flaws when teleporting players to other parts of map or just enable admin command for flying and speed boost this is just an example i cannot guarantee that will let some other scripts work property (speed boost,flying,teleport to other zone)

I made anticheat for flying,teleporting,speed hacks

Network Ownership or BodyPosition is not only problem

Don’t change NetworkOwnership script ,add new because its useless my scripts when NetworkOwnership is set to other player.

this is for speed,fly,teleport hacks this is especially for you problem:

-- Anti Teleport , Anti-Fly , Anti-Speed
-- Place this in ServerScriptService

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local CHECK_INTERVAL = 0.5 -- seconds
local MAX_WALK_SPEED = 20 -- normal walk/run speed
local MAX_TELEPORT_DISTANCE = 30 -- studs per 0.5s (natural player movement)
local MAX_AIR_HEIGHT = 10 -- studs above ground before considered flying
local MAX_AIR_TIME = 2 -- seconds

local playerData = {}

local function getGroundHeight(position)
	local rayOrigin = position
	local rayDirection = Vector3.new(0, -500, 0)

	local params = RaycastParams.new()
	params.FilterType = Enum.RaycastFilterType.Blacklist
	params.IgnoreWater = true

	local result = workspace:Raycast(rayOrigin, rayDirection, params)

	if result then
		return result.Position.Y
	else
		return nil
	end
end

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local rootPart = character:WaitForChild("HumanoidRootPart")

		playerData[player] = {
			LastPosition = rootPart.Position,
			LastGroundTime = tick(),
		}
	end)
end)

Players.PlayerRemoving:Connect(function(player)
	playerData[player] = nil
end)

RunService.Heartbeat:Connect(function(deltaTime)
	for _, player in ipairs(Players:GetPlayers()) do
		local data = playerData[player]
		if data and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
			local rootPart = player.Character.HumanoidRootPart

			local currentPos = rootPart.Position

			-- 1. Check speed (horizontal movement)
			local velocityXZ = Vector3.new(rootPart.Velocity.X, 0, rootPart.Velocity.Z)
			local horizontalSpeed = velocityXZ.Magnitude
			if horizontalSpeed > MAX_WALK_SPEED + 5 then
				rootPart.CFrame = CFrame.new(data.LastPosition)
				warn(player.Name .. " moved too fast, teleporting back.")
				continue
			end

			-- 2. Check flying
			local groundY = getGroundHeight(currentPos)
			if groundY then
				local heightAboveGround = currentPos.Y - groundY
				if heightAboveGround > MAX_AIR_HEIGHT then
					if tick() - data.LastGroundTime > MAX_AIR_TIME then
						rootPart.CFrame = CFrame.new(data.LastPosition)
						warn(player.Name .. " was flying too long, teleporting back.")
						continue
					end
				else
					data.LastGroundTime = tick()
				end
			end

			-- 3. Check sudden teleport
			local distanceMoved = (currentPos - data.LastPosition).Magnitude
			if distanceMoved > MAX_TELEPORT_DISTANCE then
				-- Player moved too far too fast = suspicious teleport
				rootPart.CFrame = CFrame.new(data.LastPosition)
				warn(player.Name .. " teleported suspiciously, teleporting back.")
				continue
			end

			-- 4. Update safe position
			data.LastPosition = currentPos
		end
	end
end)

Give something like this for your ring crediting system:

Most improtant part is check for Distance : Distance < 5:

local Players = game:GetService("Players")

local Part = Instance.new("Part") -- Change with your part

Part.Touched:Connect(function(hit)

	local Char = hit.Parent

	local Player = Players:GetPlayerFromCharacter()

	if Char and Player then

		local HumanoidrRootPart:Part = Char:FindFirstChild("HumanoidRootPart")

		local Distance = (Part.Position - HumanoidrRootPart.Position).Magnitude

		if Distance < 5 then
			-- Credit something
		end
	end
end)
1 Like

Even without ownership, if something with mass (like a character or a tool) bumps into an unanchored part, Roblox still applies force based on their physics interactions. It’s a core engine behavior and can’t be fully stopped just with ownership settings. If you set a skinny tall part’s ownership to nil you will see you can push it over with your character.

You could setup custom collision groups to stop characters from being to collide with the unanchored parts using PhysicsService. You could also try check the characters velocity, rotvelocity etc on the server but I don’t think it would be full proof.

Network Ownership in Roblox is handled so poorly, it’s incredibly exploitable and something that you actively have to work against. There really needs to be an option to enforce server-ownership on parts by default, you shouldn’t have to be manually looping and checking for this stuff it really is just bad client-trusting engine design that they never bothered improving.

nil network ownership should prevent them from collecting unanchored parts though. Maybe double check that the parts are indeed a descendant of structure. Additionally, maybe remove the if netOwner ~= nil check. Network ownership is auto by default even though the print says ‘nil’, meaning that it’s possible for exploiters to grab ownership, You need to manually set it to nil initially to prevent it from becoming auto/grabbable.

Additionally, exploiters can set their velocity to practically infinite, so regardless of their mass they can fling people and parts all over. One solution to prevent flinging might be to just disable character-character collisions, or check LinearVelocity/AngularVelocity are within reasonable limits and if not, reset them to zero and if exceeded too many times maybe force that player’s Character to be server-owned.

Best of luck dealing with this issue, exploits are an increasingly problematic issue that Roblox doesn’t really take seriously unfortunately.