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)
You should actually better insert the Accessory in the Character also I made a script for you:
local playerModel = game.Players.LocalPlayer local Character = workspace:FindFirstChild(playerModel.Name) script.Parent.MouseButton1Click:Connect(function() if Character:FindFirstChild("Humanoid") then game.ReplicatedSTorage.DarkWings:Clone().Parent = Character end end)
Also remember only the client will see the wings!