When you have 2 Guis side by side, MouseEnter messes up in the fact that when your mouse goes from 1 Gui to another, MouseLeave is fired at the same time as MouseEnter or something.. You guys get it..
No gap between guis = messed up mouse enter functions, miss-firing functions etc. How can I avoid this? Spacing out the guis is all I know of, but that won't work in my current situation. I need the guis to stay together.
local player = game.Players.LocalPlayer
for _, v in pairs(script.Parent:GetChildren()) do
if v:IsA("ImageButton") then
v.MouseEnter:connect(function()
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("ImageButton") then
script.Parent[v.Name].BackgroundColor3 = Color3.new(0,0,0)
end
end
if v.LightUp.Value == "T RA LA" then
script.Parent.Torso.BackgroundColor3 = Color3.new(1,1,0)
script.Parent.RightArm.BackgroundColor3 = Color3.new(1,1,0)
script.Parent.LeftArm.BackgroundColor3 = Color3.new(1,1,0)
elseif v.LightUp.Value == "RL LL" then
script.Parent.RightLeg.BackgroundColor3 = Color3.new(1,1,0)
script.Parent.LeftLeg.BackgroundColor3 = Color3.new(1,1,0)
elseif v.LightUp.Value == "H" then
script.Parent.Head.BackgroundColor3 = Color3.new(1,1,0)
end
end)
v.MouseLeave:connect(function()
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("ImageButton") then
script.Parent[v.Name].BackgroundColor3 = Color3.new(0,0,0)
end
end
end)
end
end

1 comment
This is a common known problem. For now until it's fixed you might just want to make your own custom event using the mouse "Move" event.