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

How to change Salute to Hands behind back? [closed]

Asked by 10 years ago

First line of script

local Salute = Holder["Salute"]

Next one I found

local SaluteIdle = true

Heres the salute function

Salute.MouseButton1Down:connect(function()
            if SaluteIdle then
                if Saluting then
                    SaluteIdle = false
                    local Torso = Char:FindFirstChild("Torso")
                    local rArm = Char:FindFirstChild("Right Arm")
                    local rWeld = Torso:FindFirstChild("Salute Weld")
                    local rShoulder = Torso:FindFirstChild("Right Shoulder")
                    if Torso and rArm and rShoulder and rWeld then
                        for i = 0, 1, 0.25 do
                            rWeld.C1 = Tween(CFrame.new(-1.5, 0.75, -0.5) * CFrame.Angles(math.rad(180), 0, math.rad(-20)),  CFrame.new(-1.5, 0.75, -0.5) * CFrame.Angles(math.rad(200), 0, math.rad(-20)), i)
                            Game:GetService("RunService").Stepped:wait()
                        end
                        wait(0.2)
                        rShoulder.Part1 = rArm
                        rWeld:Destroy()
                        Saluting = false
                        SaluteIdle = true
                    end
                else
                    SaluteIdle = false
                    local Torso = Char:FindFirstChild("Torso")
                    local rArm = Char:FindFirstChild("Right Arm")
                    local rShoulder = Torso:FindFirstChild("Right Shoulder")
                    if Torso and rArm and rShoulder then
                        rShoulder.Part1 = nil
                        local rWeld = Weld(Torso, rArm, nil, CFrame.new(-1.5, 0.75, -0.5) * CFrame.Angles(math.rad(180), 0, math.rad(-20)))
                        rWeld.Name = "Salute Weld"
                        Saluting = true
                        SaluteIdle = true
                    end
                end
            end
        end)

But the thing is theres two local scripts for hands behind back and I do not know how to make it into one in the main script.

1st script

local c0 = nil
local c1 = nil
name = "Right"
local s = nil
local w = nil
local t = nil
local c = nil
function Click(mouse)
player = script.Parent.Parent.Parent
char = player.Character
if char ~= nil then
torso = char:FindFirstChild("Torso")
arm = char:FindFirstChild(name.." Arm")
if torso ~= nil and arm ~= nil then
shoulder = torso:FindFirstChild(name.." Shoulder")
if shoulder ~= nil then
c0 = shoulder.C0
c1 = shoulder.C1
s = shoulder:clone()
shoulder.Parent = nil
local weld = Instance.new("Weld")
local yes = true
if yes then
yes = false
w = weld
t = torso
c = char
weld.Part0 = torso
weld.Parent = torso
weld.Part1 = arm
weld.C1 = CFrame.new(-0.5, -0.30, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(40), 0, math.rad(45))
end
end
end
end
end
function Unclick(mouse)
w.Parent = nil
s.Parent = t
s.C0 = c0
s.C1 = c1
local ani = char:FindFirstChild("Animate")
if ani ~= nil then
local d = ani:clone()
ani.Parent = nil
wait()
ani = d
ani.Parent = c
end
end

function Select(mouse)
mouse.Button1Down:connect(function() Click(mouse) end)
mouse.Button1Up:connect(function() Unclick(mouse) end)
end
script.Parent.Selected:connect(Select)

Second script

local c0 = nil
local c1 = nil
name = "Left"
local s = nil
local w = nil
local t = nil
local c = nil
function Click(mouse)
player = script.Parent.Parent.Parent
char = player.Character
if char ~= nil then
torso = char:FindFirstChild("Torso")
arm = char:FindFirstChild(name.." Arm")
if torso ~= nil and arm ~= nil then
shoulder = torso:FindFirstChild(name.." Shoulder")
if shoulder ~= nil then
c0 = shoulder.C0
c1 = shoulder.C1
s = shoulder:clone()
shoulder.Parent = nil
local weld = Instance.new("Weld")
local yes = true
if yes then
yes = false
w = weld
t = torso
c = char
weld.Part0 = torso
weld.Parent = torso
weld.Part1 = arm
weld.C1 = CFrame.new(0.5, -0.30, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(40), 0, math.rad(-45))
end
end
end
end
end
function Unclick(mouse)
w.Parent = nil
s.Parent = t
s.C0 = c0
s.C1 = c1
local ani = char:FindFirstChild("Animate")
if ani ~= nil then
local d = ani:clone()
ani.Parent = nil
wait()
ani = d
ani.Parent = c
end
end

function Select(mouse)
mouse.Button1Down:connect(function() Click(mouse) end)
mouse.Button1Up:connect(function() Unclick(mouse) end)
end
script.Parent.Selected:connect(Select)

But also I want it to where when you click the button all your tools disappear and you stay with your hand on your back.

Thanks if you can help!

Closed as Not Constructive by BlueTaslem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?