I'm making a GUI that is supposed to let you "breed" two animal AI, but I don't know how to tell the script to occur only when the two boxes (already created and named) are selected and the "Breed" button is clicked. I've tried to look at some other scripts to see how this is done for selecting one button, but I can't figure it out, especially for two separate buttons. I included my script below, and I am aware that it is incomplete and messy currently. Also some of the variables I have here may not make sense yet because I need them for stuff I'm gonna add in the future. Basically to clarify my question is, how can I signify that BOTH of the buttons are selected and the "Breed" button is clicked? Thanks for any and all help guys!!!
local BUTTON = script.Parent
local TOOL = script.Parent
local NAME1 = "Bull"
local NAME2 = "Cow"
local DEEDS = game.Lighting.Animals
local DEED1 = DEEDS:findFirstChild(NAME1)
local DEED2 = DEEDS:findFirstChild(NAME2)
local AFRAME = script.Parent.Parent.Parent
local NEWBUTTON = AFRAME.newButton
--not sure if i need multiple functions, maybe one for recognizing the two buttons being selected
--and one for the "Breed" button being selected?
function on_button1_down()
NEWBUTTON.MouseButton1Down:connect(function()
local current = NEWBUTTON
end)
end
---------------------------------

2 comments
so could I make the action be when the Breed Button is clicked? and are "name" and "created" the names of the two buttons in this example?
No, name and created would be the variables. You would say, "If the Part you want clicked is clicked, You would set the name variable to true. So when the brick is clicked, You would set the variable to true