Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Cloning script not working, whats wrong? [UNANSWERED]

hello, today I started playing around with meshes and some scripts, and what I tried to do is make a script that clones meshes to the characters when they join, for example lets say I got the Blue Collar cat left leg mesh, and what this script does is that it takes this mesh and clones it to the left leg of the character that joins, but it doesn't works. Heres the script:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        script.Leftarm:clone().Parent = character."Left arm"
script.Leftleg:clone().Parent = character."Left Leg"
script.Rightarm:clone().Parent = character."Right Arm"
script.Rightleg:clone().Parent = character."Right Leg"
script.Torso:clone().Parent = character.Torso
script.Mesh:clone().Parent = character.Head
    end)
end)

The meshes are inside the script.

1 answer

✓ Accepted answer
game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        script.Leftarm:clone().Parent = character."Left arm"
script.Leftleg:clone().Parent = character["Left Leg"] --bracket
script.Rightarm:clone().Parent = character["Right Arm"] --bracket
script.Rightleg:clone().Parent = character["Right Leg"] --bracket
script.Torso:clone().Parent = character.Torso
script.Mesh:clone().Parent = character.Head
    end)
end)

Since the child of "character" has a space in it, it needs to be put in brackets.

2 comments

0

ooooooooooooooooooooooooooooh!!! Thank you!

0

Please leave +Reputation :)

This discussion is preserved as it was. New answers, comments, and votes are closed.