Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I weld a Instance.new part to something in the player Torso so it moves with the player?

Asked by 7 years ago
Edited 7 years ago

I tried this,

local player = game.Players.LocalPlayer
local character = player.Character
local torso = character:WaitForChild("Torso")
local c = Instance.new("Part")
        local w = Instance.new("Weld")
        w.Part0 = c
        w.Part1 = torso
        w.Parent = c
        c.Position = torso.Position
        c.Parent = torso

I'm brand new to welding, so I'm not sure what to do as of right now. If anyone could help out that would be lovely! Thank you!

0
Hopefully this will help: http://wiki.roblox.com/index.php?title=Weld TheeDeathCaster 2368 — 7y
0
Thanks! It really helped! CommanderSkywalkerTR 5 — 7y
0
Np. :) TheeDeathCaster 2368 — 7y
0
I looked at the wiki, and this was my final result, https://gyazo.com/08f01755b3f1cc8462fbf9e102372011 It weld correctly but turning is really weird and the character bounces around. CommanderSkywalkerTR 5 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Here is a small script i made to make it so that when a player clicks a Gui Button it creates a part and welds it to the players Torso

script.Parent.MouseButton1Click:connect(function()
local part = Instance.new("Part", workspace)
local Weld = Instance.new("Weld",part)

local Torso = game.Players.LocalPlayer.Character:FindFirstChild("Torso")

part.Size = Vector3.new(1.001,1.001,1.001)
part.BrickColor = BrickColor.new("Lily white")
part.Material = "SmoothPlastic"
part.CFrame = Torso.CFrame 
part.CanCollide = false

Weld.Part0 = part
Weld.Part1 = Torso
end)
Ad

Answer this question