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

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

Asked by
wddd89 35
9 years ago

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 ='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

Log in to vote
Answered by 9 years ago
local torso = TORSOPATHHERE -- Torso
local backpack = BACKPACKPATHHERE -- Backpack
local weld ='Weld', torso)
weld.Part0 = torso
weld.Part1 = backpack
weld.C0 = torso.CFrame * backpack.CFrame:inverse()

I think it's like this...?

Should the "*" on line 6 be edited? and what does TORSOPATHHERE and BACKPACKPATH here mean? Again, sorry for sounding so dumb. :p wddd89 35 — 9y
First question: no. Second question: just put the path to the part. (E.g. game.Workspace.Player.Torso) PlanarTheorem 60 — 9y
Log in to vote
Answered by 8 years ago

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.

Answer this question