Hey everyone, I have a problem with my script. Basically the main function of this script is to add to a player custom accessory (DarkWings) from the ReplicatedStorage after player will click a gui button. For some reason it doesn't work, there might be problem with script that i created:
local playerModel = game.Players.LocalPlayer.Character
local humanoid = playerModel:WaitForChild("Humanoid")
script.Parent.MouseButton1Click:Connect(function()
if humanoid then
playerModel:AddAccessory(game.ReplicatedStorage.DarkWings)
end
end)
(I'm pretty new in scripting so there might some basic errors in this code) Edit.1 Console error: "AddAccessory is not a valid member of Model", and this accessory should be visible to everyone Edit.2 It works now, but there is now a problem with attachment accessory and clone function, in the handle of DarkWings model is already BodyBackAttachment but it doesn't work. Any idea how i can add clone function and attachment to this script?

5 comments
Check for errors in the output, or if you're testing it ingame check the developer console.
Is there any errors in the console? In addition, you might want to do it in a server script using remoteevents if you want to have the accessory visible for anyone.
Console error: "AddAccessory is not a valid member of Model", and this accessory should be visible to everyone
Oh, you need to call AddAccessory on the Humanoid. So just swap it with humanoid:AddAccessory.
Ah, it works now thanks! But there is now a problem with attachment accessory and clone function, in the handle of DarkWings model is already BodyBackAttachment but it doesn't work. Any idea how i can add clone function and attachment of this model?