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

How would I weld the front surface of a part to the player's back? [CLOSED]

I want to make a bag welded to the back of the player, and I can't think of how to do so. I have tried using cframes like :

while wait() do
script.Parent.CFrame = script.Parent.Parent.Parent.HumanoidRootPart.CFrame*CFrame.new(0,0,1) 
end

I tried welding the part to the humanoid root part :

local weld = Instance.new("Weld", script.Parent)
weld.Part0 = script.Parent.Parent.Parent.HumanoidRootPart
weld.Part1 = script.Parent

and nothing worked. I probably am making a dumb mistake but any help is appreciated. Thanks for your time

1 answer

✓ Accepted answer

I'm not sure if this is correct but you can give it a try and if it doesn't work then please respond and tell me your problem.

--//This is a script not a local script!!
local backPack = --//Path to backpack

local function givePack(plr)
	local char = plr.Character or plr.CharacterAdded:Wait()
	repeat wait() until plr.Character
	
	local humRoot = char:WaitForChild("HumanoidRootPart")
	
	local newBack = backPack:Clone()
	newBack.CFrame = CFrame.new(humRoot.CFrame - Vector3.new(0,0,newBack.Size.Z))
	local weld = Instance.new("WeldConstraint")

	weld.Parent = newBack
	weld.Part0 = newBack
	weld.Part1 = humRoot
end)
game.Players.PlayerAdded:Connect(function(plr))
	givePack(plr)
	repeat wait() until plr.Character == nil
	givePack(plr)
end)

I'm really sorry if this doesn't work. If so then please reply to this answer and I'll see what I can do to fix it!

8 comments

0

This is exactly what I wanted! I just made a small adjustment in the CFrame equation that you put, and it gave me the exact result I wanted. Thanks!

0

Great! I'm glad to hear that!

0

Great! I'm glad to hear that!

0

Great! I'm glad to hear that!

0

Great! I'm glad to hear that!

0

Great! I'm glad to hear that!

0

Great! I'm glad to hear that!

0

Great! I'm glad to hear that!

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