I'm trying to make a hat equipping suy

I’m trying to make a script that equips a hat to the player via the item Id.

I’m currently stuck with getting GetHumanoidDescriptionByUserId() to function, every time I try I get this error: GetHumanoidDescriptionByUserId is not a valid member of Players “Players”

So far I’ve tried changing the Id from player.UserId to an Id that I know works, taken the line out of the loop, and I’ve changed game:GetService(“Players”) to game.Players. Anyone know why this isn’t working?

local Players = game:GetService("Players")
local ProximityPrompt = script.Parent
local ItemID = 12977807624

ProximityPrompt.Triggered:Connect(function(player)
	
	local humanDesc = Players:GetHumanoidDescriptionByUserId(player.UserId)

	humanDesc.HatAccessory = ItemID
	game.Players.LocalPlayer.Character.Humanoid:ApplyDescription(humanDesc)
end)
1 Like

its Players:GetHumanoidDescriptionFromUserId(), not Players:GetHumanoidDescriptionByUserId()

3 Likes

It works now. I make too many mistakes like this that cost me too much time, smh.

3 Likes

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