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 a Hover over Player GUI? [UNSOLVED]

Hello. I am trying to make a hover over player GUI where basically when you hover over a player with your mouse the textlabel's text will turn into that players name and the textlabel will be visible. With this info I got this script,

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local label = player.PlayerGui.HoverGUI.TextLabel

mouse.Move:connect(function()
	local target = mouse.Target
	if target and target.Parent and game.Players:FindFirstChild(target.Parent.Name) then
		local otherPlayer = game.Players:FindFirstChild(target.Parent.Name)
		label.Text = otherPlayer.Name
		label.Position = UDim2.new(mouse.X, mouse.Y)
		label.Visible = true
	else
		label.Visible = false
	end
end)

the text label is in ----- game --> StarterGui --> HoverGui --> TextLabel HoverGui is the name of my screen GUI. This is also a local script in TextLabel

1 answer

You may want to look up how UDim2's...

UDim2 = X AXIS: (Scale,Offset) Y AXIS: (Scale,Offset)

Try (on line 10) setting the UDim2 position to just UDim2.new(0,0,0,0)

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