Hello everyone, i have a small problem with my script. Basically the main function of this script is to give a custom accessory to a player via gui button, i'm pretty sure that i made some mistakes when i was writing this code. (Btw I'm pretty new in scripting, before i was just building/3D modeling in blender, roblox sudio so thanks for any help)
local playerModel = game.Players.LocalPlayer.Character
local humanoid = playerModel:WaitForChild("Humanoid")
script.Parent.MouseButton1Click:Connect(function()
print ("Works-1")
if humanoid then
humanoid:AddAccessory(game.ReplicatedStorage.DarkWings)
print ("Works-2")
end
end)

3 comments
replace humanoid:AddAccessory with playerModel:AddAccessory the humanoid doesnt hold the accessories but the character does
also instead of addaccessory u should parent the darkwings to the character (dont know if that works better though)
There is still a problem, in console it says that "AddAccessory is not a valid member of Model"