Issues with GetPropertyChangedSignal

A few weeks ago I had written a script that increases/decreases the players walkspeed depending on the terrain/material the player is currently standing on. Fast forward to now, for some reason it fails to work when a player enters a new material.

The current code looks like this:

--// idk why this stopped working

local players = game:GetService("Players")

--// Table for all the materials and their speed
--// Their value is how much their speed decreases, NOT their walkspeed value
--// If you want the speed to increase, make the value a negative

local materials = {
	[Enum.Material.Asphalt] = 0,
	[Enum.Material.Basalt] = 0,
	[Enum.Material.Brick] = 0,
	[Enum.Material.Cobblestone] = -2.6,
	[Enum.Material.Concrete] = 0,
	[Enum.Material.CrackedLava] = 0,
	[Enum.Material.Glacier] = 0,
	[Enum.Material.Grass] = 1,
	[Enum.Material.Ground] = 2.4,
	[Enum.Material.Ice] = 0,
	[Enum.Material.LeafyGrass] = 1,
	[Enum.Material.Limestone] = 0,
	[Enum.Material.Mud] = 4.2,
	[Enum.Material.Pavement] = -2,
	[Enum.Material.Rock] = 4,
	[Enum.Material.Salt] = 0,
	[Enum.Material.Sand] = 3,
	[Enum.Material.Sandstone] = 0,
	[Enum.Material.Slate] = 3,
	[Enum.Material.Snow] = 6,
	[Enum.Material.Wood] = 0,
}

players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")
		
		--// Detects when a players floormaterial changes
		
		humanoid.Died:Connect(function()
			return print("player died, ending thread.")
		end)
		
		humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
			print("new material detected")
			-- the argument we pass is a string with the name of the property
			
			for i,v in pairs(materials) do
				if humanoid.FloorMaterial == i then
					humanoid.WalkSpeed = 16 - v
					print(humanoid.WalkSpeed)
				end
			end
		end)
	end)
end)

I have a feeling it may be an issue with humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function() due to the fact I had written down a print statement that should run every time the player enters a new material, however it does not run at all.

If someone could tell me if this is something im doing wrong on my end or if its an issue with GetPropertyChangedSignal, that would be much appreciated.

1 Like

After searching, apparently it is a bug that was supposed to be fixed but is still happening for people: Humanoid:GetPropertyChangedSignal("FloorMaterial") is broken - #8 by esoteric_skeleton

1 Like

Good to know, hopefully they fix it soon then. Till then are there any temporary solutions I can use?

1 Like

Your best approach would probably be to run a while loop and check for the FloorMaterial manually for now.

1 Like

Yooo my bad, folks. -I still need to hit the button that activates this, and due to the holiday weekend in the US, I won’t be able to roll it out until Monday morning. Thank you for your patience!

-:skull:

3 Likes

Flag flipped! Should be live now!

-:skull:

3 Likes

We’ve run into some issues with the current fix, so we turned it off, but I’m going to get it turned back on ASAP. Thanks for your patience, everyone!

-:skull:

2 Likes

This is very ridiculous. It took months to get a fix out for the bug, weeks for the fix to be turned on and rolled out and now the fix is rolled back. It’s been around 9 days and the fix is still not turned back on. Why did it even took weeks for the fix to be turned on if there has been barely any testing for it? That’s besides that it took many months for a simple bug to get a fix.

1 Like

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