Background
Right now I have a script that labels each button such as so:
local Slot1 = BagBG.Slot1 --ImageButton
local Slot2 = BagBG.Slot2 --ImageButton
local Slot3 = BagBG.Slot3 --ImageBUtton
I'm trying to make it where it's all under one variable. So when I use the MouseEnter feature it'll apply it to each one instead of having to type out multiple MouseEnter events.
I know there's a way using tables to shorten this:
local Slots = {
Slot1 = BagBG.Slot1,
Slot2 = BagBG.Slot2,
Slot3 = BagBG.Slot3
}
for i,v in pairs(Slots) do
local Button = v --is this how you go about doing it?
Button.MouseEnter:Connect(Function
print("It is functional")
end)
end
However, I don't know if this is the right way. Help will be upvoted and very appreciated!

1 comment
Omg thank you so much.