So if i were to trigger MouseEnter() on a gui, how would I know which gui that event was fired from, without having to name every single gui? Is there a better way to do this? I am trying to create an inventory gui.
Use a for loop (iteration)
local inventoryItems = script.Parent.InventoryItems -- Change this to whatever your items are inside. for i, v in pairs(inventoryItems:GetChildren()) do v.MouseEnter:connect(function() print("Mouse entered.") end) end)
With this script, v is your GUI and i would be th iterator, or the number of the GUI object in the for loop.
There's most likely a better way to do this, and it might be using UserInputService, I would give you a more detailed answer with info on that but I'm on mobile and it'll take quite a while.