I am currently working on morph script that copies parts a humanoid in replicatedstorage and clones them into your character. However when I try to clone a brick it just sticks it becomes a separate entity inside of the player rather than being attached to said player.
the script i currently have is here, with line 12 being the problem
local player = game.Players.LocalPlayer local cactus = game.ReplicatedStorage.brawler.cactusg function onClicked() player.Character.Head.face.Texture = cactus.Head.Decal.Texture cactus.Shirt:clone().Parent = player.Character cactus.Pants:clone().Parent = player.Character player.Character["Left Arm"].BrickColor = BrickColor.new("Camo") player.Character["Right Arm"].BrickColor = BrickColor.new("Camo") player.Character["Torso"].BrickColor = BrickColor.new("Camo") cactus.Head:clone().Parent = player.Character.Head end script.Parent.MouseButton1Click:connect(onClicked)
I have tried cloning cactus.Head into a bunch of different place into the player to no avail, and have run out of ideas.
So you've successfully gotten the cactus in the Character right? If that's the case you just have to stick it to the head with a weld.
Simple weld with a bit to help the cactus sticking:
cactushead = cactus.Head:Clone() cactushead.Parent = player.Character W = Instance.new("Weld",player.Character.Head) W.Part0 = W.Parent W.Part1 = cactushead
And I wouldn't recommend putting parts in parts, don't let me stop you from your dreams though.
EDIT: Here's a link to Welds to further your understanding of these incredibly useful and beautifully simple joints.
local player = game.Players.LocalPlayer local cactus = game.ReplicatedStorage.brawler.cactusg function onClicked() player.Character.Head.face.Texture = cactus.Head.Decal.Texture cactus.Shirt:clone().Parent = player.Character cactus.Pants:clone().Parent = player.Character player.Character["Left Arm"].BrickColor = BrickColor.new("Camo") player.Character["Right Arm"].BrickColor = BrickColor.new("Camo") player.Character["Torso"].BrickColor = BrickColor.new("Camo") cactus.Head:clone().Parent = player.Character.Head end script.Parent.MouseButton1Click:connect(onClicked)
the code is fine. if i am correct the problem is not with the code it is with the type of script you are using.
local player = game.Players.LocalPlayer -- local player is used when you are using a localscript.
if you are not using a local script then use that for this code