I'm trying to develop a fun tool for fun purposes as my first scripting project, and I've gotten stuck at a point where I need my script to listen for a MouseEnter event from multiple ImageButtons. I'd prefer that I keep everything in a single function if possible, instead of what I'm currently doing.
I've included some of what I have in place currently:
function keyInfo(key)
local children = key:getChildren()
script.Parent.Console.Text = script.Parent.key.children[1].Name
end
script.Parent.key.MouseEnter(keyInfo())
-- When a key on the Gui-Keyboard is moused over, find that key and display the name of it's child on a TextLabel.
^ I'm not expecting this to work, it's simply a messy placeholder.
This is the script I have temporarily pasted into each of the TextLabels as a workaround:
function keyInfo()
if script.Parent.Name ~= "TextLabel" then-- If the name of the TextLabel hasn't been changed, ignore it.
script.Parent.Parent.Parent.Console.Text = script.Parent.Name
else end
end
script.Parent.Parent.MouseEnter:connect(keyInfo)
I'd rather not have to use 26 different scripts within the TextLabels, it gets messy, especially if I want to modify it.
Here is a link to Imagebin, where I've uploaded a screenshot of my Explorer window, in-case I was being unclear.
Taking all answers, and anything else you'd like to tell me.

3 comments
I attached that Imagebin link so you can see what is a Parent of what, and it would be nice if you could explain the different steps this script would go through. Thanks~
One thing, where did the variable "Child" come from? Other than that, thanks for the help!
The Variable "Child" can be anything if you do not already know. I just used it because everything that would be that variable is the Child of what I took children from