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

Mouser Over Brick Text?

I'm trying to make a brick where you hover over the brick and some text appears by your cursor, and if you move the cursor while still on the brick it follows the cursor until you stop hovering over the brick. Thanks to https://scriptinghelpers.org/questions/16904/how-can-i-make-it-when-my-mouse-hovers-over-a-player-a-gui-comes-up-with-there-name this is what I have so far:

local Player = Game.Players.LocalPlayer 
local Mouse = Player:GetMouse()
local aText = "Testing 1, 2, 3..."
Mouse.TargetFilter = nil

Mouse.Move:connect(function() 
    if not Mouse.Target.Parent then return end

    if Mouse.Target and Mouse.Target.Parent == script.Parent then 
        Player.PlayerGui.ScreenGui.SpecialHoverGui.Text = aText
        Player.PlayerGui.ScreenGui.SpecialHoverGui.Visible = true 
    elseif Mouse.Target and Mouse.Target.Parent ~= script.Parent then 
        Player.PlayerGui.ScreenGui.SpecialHoverGui.Visible = false 
    end
end)

However this does not work, could anybody help? Thanks.

1 comment

0

Where is this script located? Is it in a part?

2 answers

Try putting a click detector inside the brick with the script in it, then using this function:

script.Parent.ClickDetector.MouseHoverEnter:connect(function()
	--code goes here
end)

2 comments

0

I've already tried this before posting the question, and it is no help.

0

Where is the local script (If it is inside one, local player only works inside a local script)?

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