Code sample issue on FloorMaterial page

There’s both a code sample issue and an unclear reference that may be confusing for newer developers.

Page:

Issue

local Humanoid = route.to.humanoid --should probably have a comment here for new developers that wouldn't know what this means

Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
	print("New value for FloorMaterial: " .. Humanoid.FloorMaterial) --this line is the issue
end)

Error: Attempt to concatenate string with EnumItem

Fix

local Humanoid = route.to.humanoid --reference a character's humanoid here

hum:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
	print("New value for FloorMaterial: " .. tostring(hum.FloorMaterial))
end)

Convert the FloorMaterial enum to a string.

Hey! Thanks for this report, I’ve just added it to our todo list and we’ll get to it as soon as we can :slight_smile:

3 Likes

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