I have a script which is meant to put a motor6D in the players Upper Torso, but when I play it, it prints that it created the motor6D but it didn’t. I can’t figure out why it isn’t working since I watched a youtube tutorial and even tried out the model to get it to work, but still it didn’t work.
game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.CharacterAppearanceLoaded:Connect(function(char)
local M6D = Instance.new("Motor6D", char:WaitForChild("UpperTorso"))
M6D.Name = "ToolGrip"
print("Made Motor6D")
end)
end)
game:GetService("ReplicatedStorage").ConnectM6D.OnServerEvent:Connect(function(plr, location)
local char = plr.Character
if not char then return end
local UT = char:WaitForChild("UpperTorso")
local TG = UT:WaitForChild("ToolGrip")
TG.Part0 = UT
TG.Part1 = location
end)
game:GetService("ReplicatedStorage").DisconnectM6D.OnServerEvent:Connect(function(plr)
local char = plr.Character
if char then
char:WaitForChild("UpperTorso"):WaitForChild("ToolGrip").Part1 = nil
end