FloorMaterial Listener not firing

try this as a hacky workaround until roblox fixes the bug

local Players = game:GetService("Players")

local function playerAdded(player)
	player.CharacterAdded:Connect(function(character)
		local previousMaterial
		character.Humanoid.Changed:Connect(function()
			local newMaterial = character.Humanoid.FloorMaterial
			
			if newMaterial ~= previousMaterial then
				print("FloorMaterial changed to", character.Humanoid.FloorMaterial)
				previousMaterial = newMaterial
			end
		end)
	end)
end

for _, player in Players:GetPlayers() do
	playerAdded(player)
end

Players.PlayerAdded:Connect(playerAdded)
2 Likes

oK did some investigating and it’s a roblox bug. Couldn’t reproduce it in studio but remembered reading something about it in the latest release notes. Fix is pending

Release notes for last week vvv

2 Likes

Tested this and it works

1 Like

Thank you! I will use for now. :happy1:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.