Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

MouseEnter and MouseLeave won't work on SurfaceGui, help?

I have this script in an ImageButton:

local fx =  workspace.iBlox.Screen.Desktop.Login.ppicturehold.hoverFX
local bkg = workspace.iBlox.Screen.Desktop.Login.ppicturehold.buttonbckgd
local butt = workspace.iBlox.Screen.Desktop.Login.ppicturehold.loginbutton

butt.MouseEnter:connect(function()
fx.Visible = true
bkg.Visible = true
end)

butt.MouseLeave:connect(function()
fx.Visible = false
bkg.Visible = false
end)

It's supposed to make 2 other GUI elements appear when the mouse hovers over it but it just doesn't do anything.

Help?

1 answer

This is the problem:

local fx =  workspace.iBlox.Screen.Desktop.Login.ppicturehold.hoverFX
local bkg = workspace.iBlox.Screen.Desktop.Login.ppicturehold.buttonbckgd
local butt = workspace.iBlox.Screen.Desktop.Login.ppicturehold.loginbutton

Always don't forget not to skip game to workspace.

local fx = game. workspace.iBlox.Screen.Desktop.Login.ppicturehold.hoverFX
local bkg = game.workspace.iBlox.Screen.Desktop.Login.ppicturehold.buttonbckgd
local butt = game.workspace.iBlox.Screen.Desktop.Login.ppicturehold.loginbutton

This discussion is preserved as it was. New answers, comments, and votes are closed.