Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] Script automatically deletes children of an accessory?

Asked by 5 years ago
Edited 5 years ago

I have a script that basically welds an accessory to my head. It works fine in a localscript, however I need it in regular script. So, I copied and pasted it into a regular script but now the script automatically deletes all the children of the accessory. Am I doing something wrong? How could I prevent this?

wait(5)

local player = game.Players.TrixitesWasTaken
local char = player.Character
local eyes = game.ReplicatedStorage.Accessory:Clone()
local head = char.Head

head.Transparency = 1

eyes.Handle.Handle.C1 = CFrame.Angles(math.rad(180), 0, 0) 
eyes.Handle.Eye.Eye.C1 = CFrame.Angles(math.rad(180), 0, 0)
eyes.Handle.Eye1.Eye1.C1 = CFrame.Angles(math.rad(180), 0, 0)
eyes.Handle.Middle.Middle.C1 = CFrame.Angles(math.rad(180), 0, 0)
eyes.Handle.Part.Part.C1 = CFrame.Angles(math.rad(180), 0, 0)

eyes.Handle.Handle.Part1 = head
eyes.Handle.Handle.Part0 = eyes.Handle
eyes.Handle.Part.Part.Part1 = head
eyes.Handle.Middle.Middle.Part1 = head
eyes.Handle.Eye1.Eye1.Part1 = head
eyes.Handle.Eye.Eye.Part1 = head

0
You should be using the function in humanoid to add an accessory User#5423 17 — 5y
0
Except when I do that it doesn't weld so it falls apart + the children of the accessory still get deleted TrixitesWasTaken 13 — 5y
0
Also remember that pi is 180 degrees in radians, so don't waste your time doing math.rad(180), just do math.pi User#24403 69 — 5y

Answer this question