Morning guys, so i got a problem while attempting to insert a Motor6D when a player joins, using instance.new() function, what may be the problem? why is instance.new() not working? It must be parented to the torso of a player but there is not Motor6D in Torso.
What you could try doing is waiting for the character to load using the Player.CharacterAdded Event. So when your character loads, you can index the torso no issue for example:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local torso = character:WaitForChild(“Torso”)
local m6d = Instance.new(“Motor6D”, torso)
m6d.Name = “Name here”
end)
end)
Edit: Sorry if there are errors, I’m on a phone lol and I fixed a small issue with the Instance.new() (Not declaring the parent)
Edit2: Keep in mind that if it’s r15 then there is a lower and upper torso.
You are doing this on PlayerAdded when you should be doing this on CharacterAdded. Also, please set the parent last. Setting parent first is bad practice due to the fact that it is bad performance/efficiency-wise.