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

How would this work?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Here's a script that I use. It's made for one hand to hold on the gun but, how am I going to put two hands on the gun instead of one?

sp = script.Parent

Mesh = false -- If true will load BC 2.0 Arm meshes as well. Shirt = true -- If true will load the user's shirt to the arms as well

function onEquipped(mouse) local Player = game:GetService("Players").LocalPlayer
local Cam = game.Workspace.CurrentCamera

local Arms = Instance.new("Model")
Arms.Name = "Arms"
Arms.Parent = Cam

if Shirt == true then
    local Humanoid = Instance.new("Humanoid")
    Humanoid.MaxHealth = 0
    Humanoid.Health = 0
    Humanoid.Name = ""
    Humanoid.Parent = Arms

    local newShirt = Player.Character:FindFirstChild("Shirt"):clone()
    newShirt.Parent = Arms
else end

local RightArm = Player.Character:FindFirstChild("Right Arm"):clone()
RightArm.Name = "Right Arm"
RightArm.Transparency = 0.1

local w = Instance.new("Weld")
w.Part0 = RightArm
w.Part1 = Player.Character:FindFirstChild("Right Arm")
w.C0 = CFrame.new()
w.C1 = CFrame.new()
w.Parent = RightArm 
RightArm.Parent = Arms

local LeftArm = Player.Character:FindFirstChild("Left Arm"):clone()
LeftArm.Name = "Left Arm"
LeftArm.Transparency = 0.1  

local w = Instance.new("Weld")
w.Part0 = LeftArm
w.Part1 = Player.Character:FindFirstChild("Left Arm")
w.C0 = CFrame.new()
w.C1 = CFrame.new()
w.Parent = LeftArm  
LeftArm.Parent = Arms

if Mesh ~= false then
    local LeftArmMesh = script:FindFirstChild("LeftArm")
    LeftArmMesh.Parent = LeftArm
    local RightArmMesh = script:FindFirstChild("RightArm")
    RightArmMesh.Parent = RightArm
else end

end

function onUnequipped(mouse) local Player = game:GetService("Players").LocalPlayer
local Cam = game.Workspace.CurrentCamera for _, Model in pairs(Cam:GetChildren()) do if Model.Name == "Arms" then Model:remove() else end end end

sp.Equipped:connect(onEquipped) sp.Unequipped:connect(onUnequipped)

Answer this question