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

How to make hover over text?

Asked by 1 year ago
Edited by ScriptGuider 1 year ago

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

Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

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

0
ive just done this and had a error saying Players.BFFARESOOCOOL.PlayerGui.Magic.LocalScript:1: attempt to index nil with 'MouseEnter' bffaresoocool -10 — 1y
0
Can you send the whole script before you changed it? T3_MasterGamer 2189 — 1y
Ad

Answer this question