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

How to weld mesh parts without having to use a tool?

local players = game.Players.LocalPlayer
local character = players.Character
local Torso = character:FindFirstChild("UpperTorso") or character:WaitForChild("UpperTorso")
local Coat = script.Parent.Parent.CoatMesh

Coat.CFrame = Torso.CFrame * CFrame.new(0,-1.5,1)
local weld = Instance.new("Weld")
weld.Parent = script.Parent
weld.Part0 = Coat
weld.C0 = Coat.CFrame:inverse()
weld.Part1 = Torso
weld.C1 = Torso.CFrame:inverse()
Coat.Anchored = false

This works when its inside a Tool, but I want it welded to my torso at all times without a tool. Here's how it looks currently https://imgur.com/a/pKAvclt

6 comments

0

glue it to the players back

0

Local scripts don't run in workspace.

0

Its not inside a local script.

0

You can't use local player inside a server script.

0

How can I get a specific player without using Local Player? I tried using PlayerAdded but that didn't work either :/

0

Look at answer.

1 answer

✓ Accepted answer
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local Torso = char:WaitForChild("UpperTorso")
		local Coat = script.Parent.Parent.CoatMesh
		Coat.CFrame = Torso.CFrame * CFrame.new(0,-1.5,1)
		local weld = Instance.new("Weld")
		weld.Parent = script.Parent
		weld.Part0 = Coat
		weld.C0 = Coat.CFrame:inverse()
		weld.Part1 = Torso
		weld.C1 = Torso.CFrame:inverse()
		Coat.Anchored = false
	end)
end)

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