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

Make a "backpack" stick on the player's torso?

I know for sure this has to do with welds, and this time I would really appreciate a full script (sorry for being greedy if i do sound like it). The model is called "backpack", if you need to know what it is. So, this is what I have tried but never got it to work...

local w = Instance.new('Weld', Workspace)
w.backpack = Workspace.Player.Torso
-- is stuck here

sorry if i sound so dumb and ask an OVERLOAD amount of questions. i just need as much help as i can so i can become atleast somewhat of a decent scripter lol

EDIT: backpack needs to be behind the person's torso (isn't that what a backpack is? lol)

2 answers

local torso = TORSOPATHHERE -- Torso
local backpack = BACKPACKPATHHERE -- Backpack
local weld = Instance.new('Weld', torso)
weld.Part0 = torso
weld.Part1 = backpack
weld.C0 = torso.CFrame * backpack.CFrame:inverse()

I think it's like this...?

2 comments

0

Should the "*" on line 6 be edited? and what does TORSOPATHHERE and BACKPACKPATH here mean? Again, sorry for sounding so dumb. :p

0

First question: no. Second question: just put the path to the part. (E.g. game.Workspace.Player.Torso)

To get things to line up correctly, I treated backpacks as hats , used a hat giver script, then added the weld and removed the hat object (so the player can't remove the backpack with delete key)

In the backpack model the Handle is set where the player's head would be. Just some helpful ideas that I've used.

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