I am trying to clone a hat to my player but whenever it is cloned it appears in a place and falls off the map, what do I do?
Are you using an attachment? is the hat anchored?
How are you trying to put it on the player? Are you using the AddAccessory
function of their humanoid to add it to them or a different method?
yep, i’m using the attachment and the anchor is not active
I don’t know how to use the Add Accessory function, I just put it as I learned from youtube
Simply make a clone of the hat and put it in the argument for AddAcecssory
Example, say the humanoid is stored in a variable called humanoid
, and your hat is in a variable called hat
, you’d do
humanoid:AddAccessory(hat)
If you already have a clone of it in that variable or
humanoid:AddAccessory(hat:Clone())
If you don’t have a clone set up
Players.skowdash.Backpack.LocalScript:48: attempt to index nil with ‘AddAccessory’
i got his problem, It is a model that I did hat
Can I see the script you’re using
scp323.Triggered:Connect(function()
if deb == false then
clear = true
deb = true
humanoid:AddAccessory(skull:Clone())
wait(1)
end
end)
You need to define humanoid, and what are you trying to add the hat to?
From the looks of it, you don’t have a humanoid variable set up. Since this is a localscript, do you already have the character of the player in a variable? If so, just get the humanoid from that
If this is a localscript, here’s what you can do:
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:wait()
local humanoid = char:WaitForChild("Humanoid")
scp323.Triggered:Connect(function()
if deb == false then
clear = true
deb = true
humanoid:AddAccessory(skull:Clone())
wait(1)
end
end)
the same thing keeps happening to me
Is the player’s character a custom character? If so, then maybe the attachments that are normally in their own characters are not in the custom one?
I know that everything is in its place because since I started the project I have not touched anything important, is own characters
Could it be something up with the hat itself then? Are the right attachments in the hat’s Handle?
The skill doesn’t have a Weld, you need one relating to the body part and accessory for it to attach.