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

Run 2 functions OnEuipped()?

Asked by
KAAK82 16
10 years ago
Tool = script.Parent

function Arms()
Head = script.Parent.Parent.Head
LArm = script.Parent.Parent['Left Arm']
RArm = script.Parent.Parent['Right Arm']

LFake = LArm:clone()
LFake.Parent = Tool
RFake = RArm:clone()
RFake.Parent = Tool
LFake.BrickColor = LArm.BrickColor
RFake.BrickColor = RArm.BrickColor
Weld1 = Instance.new('Weld', RFake)
Weld1.Part0 = RFake
Weld1.Part1 = RArm
Weld2 = Instance.new('Weld', LFake)
Weld2.Part0 = LFake
Weld2.Part1 = LArm
end

function HeadtoArms()
local char = game.Players.LocalPlayer.Character
local weld = Instance.new('Weld', char.Head)
weld.Part0 = char.Head
weld.Part1 = char['Left Arm']
weld.C0 = CFrame.new()
weld.C1 = weld.Part1.CFrame:inverse() * weld.Part0.CFrame

local char = game.Players.LocalPlayer.Character
local weld = Instance.new('Weld',char.Head)
weld.Part0 = char.Head
weld.Part1 = char['Right Arm']
weld.C1 = CFrame.new()
weld.C1 = weld.Part1.CFrame:inverse() * weld.Part0.CFrame
end

script.Parent.Equipped:connect(HeadtoArms)
script.Parent.Equipped:connect(Weld)

1 answer

Log in to vote
0
Answered by 10 years ago

If that doesn't work, try calling both functions, within the event, as such :

script.Parent.Equipped:connect(function()
    HeadToArms();
    Weld();
end)
0
doesnt ork but thnx for trying KAAK82 16 — 10y
Ad

Answer this question