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

Mouser Over Brick Text?

Asked by
A9X 10
9 years ago

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:

01local Player = Game.Players.LocalPlayer
02local Mouse = Player:GetMouse()
03local aText = "Testing 1, 2, 3..."
04Mouse.TargetFilter = nil
05 
06Mouse.Move:connect(function()
07    if not Mouse.Target.Parent then return end
08 
09    if Mouse.Target and Mouse.Target.Parent == script.Parent then
10        Player.PlayerGui.ScreenGui.SpecialHoverGui.Text = aText
11        Player.PlayerGui.ScreenGui.SpecialHoverGui.Visible = true
12    elseif Mouse.Target and Mouse.Target.Parent ~= script.Parent then
13        Player.PlayerGui.ScreenGui.SpecialHoverGui.Visible = false
14    end
15end)

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

0
Where is this script located? Is it in a part? DigitalVeer 1473 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

Hover over the characters and trees in this game, tell me if that's what you need.

0
The game is not active A9X 10 — 9y
Ad
Log in to vote
-1
Answered by 9 years ago

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

1script.Parent.ClickDetector.MouseHoverEnter:connect(function()
2    --code goes here
3end)
0
I've already tried this before posting the question, and it is no help. A9X 10 — 9y
0
Where is the local script (If it is inside one, local player only works inside a local script)? Noobegai -4 — 9y

Answer this question