How to create label pop up

hello dev forum im trying to make a label pop up when my mouse is over certain props but i cant find on how to do it or what its even called. but im trying to get a slim label to apear and sorta do something im not sure but i mainly am just trying to get it so apear when the mouse is over the prop
this gif is kindaa what i mean with my mouse

its gonna be the last thing i do before i start working on maps
and here is the game
https://www.roblox.com/games/5949918370/Stare-at-a-Broken-pc?refPageId=67a8825e-51af-44a7-a08e-97f49f130b09

2 Likes

You can use Mouse.Move to make it trigger whenever the mouse is moving around your prop. Then you can do Mouse.Target to see if the Target ~= nil and if it’s equal to your objects name.

Don’t forget to also put the label in your mouse’s position.

  TextLabel.Position = UDim2.new(0.003, Mouse.X, -0.025, Mouse.Y)```
3 Likes

that feels familiar but how would i get the guis to pop up even when the mouse is hovering over it and stil do something like move?

2 Likes

That’s what Mouse.Move is for.

3 Likes
local localPlayer = game.Players.LocalPlayer
local Mouse = localPlayer:GetMouse()

Mouse.Move:Connect(function()
	script.Parent.Position = UDim2.new(0, Mouse.X + -5, 0, Mouse.Y + -5)
	script.Parent.Visible = false
	local Target = Mouse.Target
	if Target and Target.Name == "PC" then
		script.Parent.Text = Target.Name
		script.Parent.Visible = true
	end
end)

The script above should work as it works for me. Just ask me anything if there is an error.

1 Like

how would i set it up though? like with text guis?

1 Like

Well, sorry for not saying. You should put that script in a localscript and in a gui

1 Like

so id make a frame for gui oh the entire screen put a local script in each of the things i want to pop up?

1 Like

well, imma publish the whole thing as a model

1 Like

this way is just a basic one that i know.

1 Like

MouseoverGui.rbxm (3.2 KB)
@Troublemaiker here is the file

1 Like

its not letting me open it is it s a game file or something else i can try?

1 Like

Sorry, I am currently on mobile. So I am going to show you what did I do:

  • Create a TextLabel in a Gui
  • Add a LocalScript in the TextLabel and put the code above there.
1 Like

im also gonna be doing this o the game so i want to be sure im going to add maps other then this one i just want to finish some special touches before i start working on more maps so will i be able to just switch to a different map and the gui is still there and will get in the way so i think ill need to make it disaoear on key change or somthing like that

1 Like

Does the script work or there is any error?

there is an error on Player
how would i fix that?

1 Like

I fixed that. You should scroll up and check it

1 Like

ive done what u said and nothings happening it loads in and disapears

1 Like

Well, are there any errors? You should untick the ResetOnSpawn property of the Gui.

Here is the place that I made. Edit it and copy the Gui.
@Troublemaiker