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

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

Asked by
wddd89 35
10 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 = 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

Log in to vote
1
Answered by 10 years ago
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...?

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