Can Humanoid.FloorMaterial be spoofed by the client?

Saw a suggestion for a serversided anti-fly involving humanoid.FloorMaterial and decided to write a quick little test, and it seems to work reliably. The only concern I have is whether or not humanoid.FloorMaterial is able to be modified in any way by the client. I would assume not given that it appears to be a readonly value, but wanted to get a second opinion anyways.

Here’s the code:

local WarnTable = {}

game:GetService("RunService").Heartbeat:Connect(function()
	for _,v in pairs(game.Players:GetPlayers()) do
		local char = v.Character
		if char then
			local FloorMaterial = char.Humanoid.FloorMaterial
			if FloorMaterial == Enum.Material.Air then
				if WarnTable[v.UserId] == nil then WarnTable[v.UserId] = os.time() end
				if WarnTable[v.UserId] + 10 < os.time() then				
					WarnTable[v.UserId] = nil
					v:LoadCharacter()
				end
			else
				WarnTable[v.UserId] = nil
			end
		end
	end
end)

The only other concern I have with this is that heartbeat connection in servers with 40+ people in it. Maybe a less frequent loop?

In my opinion, Instead of FloorMaterial, you should go for Raycasting, it’s more reliable than checking if the floor material is air.

1 Like


From the roblox developer hub, since this is a read only parameter this cannot be falsified.

For more info: Humanoid.FloorMaterial (roblox.com)

2 Likes