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
