Parenting Objects with Player Who Clicks Gui

hey! i am trying to make a script where if a player clicks a gui, then their character wears an accessory. the accessory is currently stored in ReplicatedStorage and the script is in the textbutton.

any help is appreciated !! <33

local button = script.Parent
local BlondeHair = game.ReplicatedStorage.NCBlack

button.MouseButton1Click:Connect(function(Click)
	local player = game.Players:FindFirstChild(Click.Parent)
	if player and player.Character then
		BlondeHair:Clone().Parent = player.Character
	end
end)
  1. You should use RemoteEvents, so all players would be able to see the Client Character change/update.

  2. I’d suggest to do: local Clone = BlondeHair:Clone() and the, Clone.Parent = Player.Character.

  3. To find the player, I’d do it through server-side.

1 Like