I need help fixing a script that i dont even understand i made it

need help fixing this i need a script that opens a description when you hover over it with your mouse and closes when you take your mouse off of it i need the text to change depending on what imagelabel it is the code i tried to make dosent even work becuase idk what im doing

local image = game.StarterGui.SideButtongui.TextLabel
local sel = script.Parent
if sel.MouseEnter then	
	image.Visible = true

elseif sel.MouseLeave then
	image.Visible = false

end

( i am very new to coding)

1 Like

I think this is 3rd time you make topic about this already but here is what you done wrong .MouseEnter and.MouseLeave Event need to be connect to function you will need to change this line

To

sel.MouseEnter:Connect(function()
image.Visible = true
end)


sell.MouseLeave:Connect(function()
image.Visible = false
end)

i tried making it different so i can just get help on my script

should i put it in a local script or a script

It should be a local script (character limit)

Try this script

local image = game.Players.LocalPlayer.PlayerGui:WaitForChild("SideButtongui").TextLabel
local sel = script.Parent

sel.MouseEnter:Connect(function()
	image.Visible = true
end)

sel.MouseLeave:Connect(function()
	image.Visible = false
end)
1 Like

Thank you im almost done with an update for my game and this really helps