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

How do i weld a part of a model or model to the player?[UNANSWERED]

Asked by
LevelKap 114
10 years ago

Hopefully i can convey what i'm about to say in words: - I'm working on an fps(Similar to the popular Roblox version of Battlefield made by deadzonezack). - I created a fake torso and fake arms so i'd be able to customize them a bit more and keep them upward(similar to how it looks when you equip a tool, except i didn't want to use tools, so there wouldn't be the tool icon on the bottom and the player wouldn't have to manually equip it.) I used the lock first person code to keep my character in first person mode. -I CFramed a gun and grouped it into a model(don't worry it's proportional.) The problem i'm having is, i can't find a way to weld the handle of the gun to my player's arm and still bring all the rest of the model with it. I know that i can just build the gun through scripts and weld each individual piece to each other, leading up to my arm, but I was wondering if anyone knew how to weld this gun model to my arm, so i can later move my arm and manipulate the gun(zooming in, etc.) I would hate to have to remake the gun with scripting and then weld each individual piece. *Some things you might need to know, here is the script for the fake arms:

Player = game.Players.LocalPlayer
Char = Player.Character
Mouse = Player:GetMouse()
Torso = Char.Torso
RightA = Char["Right Arm"]
LeftA = Char["Left Arm"]
RightL = Char["Right Leg"]
LeftL = Char["Left Leg"]
RightS = Char.Torso["Right Shoulder"]
LeftS = Char.Torso["Left Shoulder"]
Face = Char.Head.face


--game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

Player:ClearCharacterAppearance()
wait()
Torso.BrickColor = BrickColor.new("Bright red")
RightL.BrickColor = BrickColor.new("Bright blue")
LeftL.BrickColor = BrickColor.new("Bright blue")
Face:Destroy()

RightS.Part1 = nil
LeftS.Part1 = nil

FRArm = Instance.new("Part")
FRArm.Parent = Workspace
FRArm.FormFactor = "Custom"
FRArm.TopSurface = 0
FRArm.BottomSurface = 0
FRArm.Material = "SmoothPlastic"
FRArm.BrickColor = BrickColor.new("Nougat")
FRArm.Size = Vector3.new(1,2,1)

RWeld = Instance.new("Weld")
RWeld.Parent = Char
RWeld.Part0 = Torso
RWeld.Part1 = FRArm
RWeld.C1 = RightS.C1
RWeld.C0 = CFrame.new(1,0.5,0) * CFrame.Angles(0,math.rad(90),math.rad(90))

-- If i ever decide to create a left arm.
--FLArm = Instance.new("Part")
--FLArm.Parent = Workspace
--FLArm.FormFactor = "Custom"
--FLArm.TopSurface = 0
--FLArm.BottomSurface = 0
--FLArm.Material = "SmoothPlastic"
--FLArm.BrickColor = BrickColor.new("Nougat")
--FLArm.Size = Vector3.new(1,2,1)

--LWeld = Instance.new("Weld")
--LWeld.Parent = Char
--LWeld.Part0 = Torso
--LWeld.Part1 = FLArm
--LWeld.C1 = LeftS.C1
--LWeld.C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(0,math.rad(-90),math.rad(-90))

Clarification of Question: How do i make it so i can weld the model to my arms?

Answer this question