I want to identify a humanoid with a right leg, and change the brickcolor to Really red. I keep getting this error and I cannot figure out what's wrong. Thanks!
part = script.Parent.Part
game.Players.PlayerAdded:connect(function()
local plr = {game.Players}
for i,v in pairs(plr) do
char = v:GetPlayerFromCharacter(plr)
if char then
hum = char:FindFirstChild("Humanoid")
if hum then
hum.RightLeg.BrickColor = BrickColor.new("Really red")
end
end
end
end)

2 comments
Helpful, however now I'm still getting an error that says "Unable to cast value to object" on Line 5.
Try char = game.Players:GetPlayerFromCharacter(v).