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

How to make hover over text?

Hi im recently making this the vampire diaries game on roblox! and i want it so that when i hover over the health ui and magic ui it shows health and magic text. If you could help me do this id be really greatful. (Heres my current scripts)

if Gui.MouseEnter == true then
	game.StarterGui.Magic.Frame["Magic Amount"].Transparency = 0
else 
	game.StarterGui.Magic.Frame["Magic Amount"].Transparency = 1
	
	end

This is a local script in my gui

1 answer

GuiObject.MouseEnter is an event, not a property nor a boolean. Also in replace of if Gui.MouseEnter == false then use GuiObject.MouseLeave event.

Gui.MouseEnter:Connect(function()
	-- replaced game.StarterGui with Player.PlayerGui
	game.Players.LocalPlayer.PlayerGui.Magic.Frame:WaitForChild("Magic Amount").Transparency = 0
end)
Gui.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Magic.Frame:WaitForChild("Magic Amount").Transparency = 1
end)

If you don't know how to use events or don't know them at all, check these out:

  1. https://create.roblox.com/docs/reference/engine/datatypes/RBXScriptSignal

  2. https://create.roblox.com/docs/scripting/events#using-events

  3. https://create.roblox.com/docs/scripting/events/bindable-events-and-functions

  4. https://create.roblox.com/docs/scripting/events/remote-events-and-functions

2 comments

0

ive just done this and had a error saying Players.BFFARESOOCOOL.PlayerGui.Magic.LocalScript:1: attempt to index nil with 'MouseEnter'

0

Can you send the whole script before you changed it?

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