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

Why won't this localscript 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.

Why won't this localscript work? Take a look at the script:

gun = script.Parent
Player = game.Players.LocalPlayer
la = Player.Character:FindFirstChild("Left Arm")
t = Player.Character:FindFirstChild("Torso")
rs = Player.Character.Torso:FindFirstChild("Right Shoulder")
ls = Player.Character.Torso:FindFirstChild("Left Shoulder")

local function weldBetween(a, b)
    local weld = Instance.new("Weld")
    weld.Part0 = a
    weld.Part1 = b
    weld.C0 = CFrame.new()
    weld.C1 = b.CFrame:inverse() * a.CFrame
    weld.Parent = a
    return weld;
end

function localequipped()
    rs.C0 = CFrame.new(0.5,1,0) *CFrame.fromEulerAnglesXYZ(1,1,1)
end

function localunequipped()
 rs.C0 = CFrame.new(-0.5,-1,-0) *CFrame.fromEulerAnglesXYZ(-1,-1,-1)
end
gun.Equipped:connect(localequipped)
gun.Unequipped:connect(localunequipped)

There is no errors it just won't work at line 23 like it won't minus anything.

Answer this question