I made two parts. One as the turn on and off button and the other to click to shoot button. Well, the problem is that, every time I click it, it does go down, but instead when I hit the shoot button, the other button goes down rather than staying down. I want the ActivateShoot part to be the on/off button for the other part. So let's say I turn on the ActivateShoot button, what it should do is go down to the position that I put and function the Shoot part. And if I click the ActivateShoot part again, it will be off and the Shoot part will not work, as in disabled unless you turn it back on. I hope I am being clear to what I am trying to do here. Sorry for the confusion!
-- Combining the Shoot and Activation --
AS = script.Parent.Parent.ActivateShoot
asOn = false
Shoot = script.Parent.Parent.Shoot
shootOn = false
function onClicked()
if not asOn then
asOn = true
AS.CFrame = AS.CFrame+Vector3.new(0,-0.09,0)
AS.BrickColor = BrickColor.new("Shamrock")
shootOn = true
Shoot.CFrame = Shoot.CFrame+Vector3.new(0,-0.09,0)
Shoot.BrickColor = BrickColor.new("Shamrock")
wait(0.05)
Shoot.CFrame = Shoot.CFrame+Vector3.new(0,0.09,0)
Shoot.BrickColor = BrickColor.new("Bright red")
elseif asOn then
asOn = false
AS.CFrame = AS.CFrame+Vector3.new(0,0.09,0)
AS.BrickColor = BrickColor.new("Bright red")
shootOn = false
end
end
script.Parent.Parent.ActivateShoot.ClickDetector.MouseClick:connect(onClicked)
script.Parent.Parent.Shoot.ClickDetector.MouseClick:connect(onClicked)

4 comments
It didn't work though. When I clicked the part didn't even go down.
You make the part go down your self^^!!!common sense!!!...
Did you add the extra code to include the variables and the CFrame movement? I only included half the code to show you what to change. You have to fill in the rest.
Oh okay. I see. I'm sorry!