Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
0
Answered by
ziploz 7
6 years ago
Edited 6 years ago

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
Ad

Answer this question