I want the players name tag to appear when I hover my mouse on the player. But I'm not sure how to start, can someone help?
This is what I got for objects, is there a way to tweak it for players?
local Player = game:GetService("Players").LocalPlayer -- Get the player
local Mouse = Player:GetMouse() -- Get the player's mouse
-- Just creating a name tag for this example. This is assuming the script is inside a ScreenGui that's in the PlayerGui.
local Tag = Instance.new("TextLabel",script.Parent)
Tag.Text = ""
Tag.Visible = false
Tag.TextColor3 = Color3.new(1,1,1)
Tag.Font = "ArialBold"
Tag.FontSize = "Size18"
Tag.BackgroundColor3 = Color3.new(0,0,0)
Tag.BackgroundTransparency = 0.5
Tag.TextXAlignment = "Left"
-- Connect the "Move" event to the mouse
Mouse.Move:connect(function()
local Target = Mouse.Target -- Get the object the mouse is hovering over
if Target then -- Make sure the target exists
-- Update the information when a target exists
Tag.Text = Target.Name
Tag.Size = UDim2.new(0,Tag.TextBounds.X,0,20) -- TextBounds.X will make the tag be as long as the text, giving it a more complimenting appearance
Tag.Visible = true
-- If no target exists, then...
else
-- Hide the tag
Tag.Visible = false
end
-- Update the tag's position with the mouse
Tag.Position = UDim2.new(0,Mouse.X-Tag.AbsoluteSize.X,0,Mouse.Y-Tag.AbsoluteSize.Y)
end)

2 comments
Thanks, can u tell me if I should put the script in the workspace of not?
Did you figure it out? if not No, LocalScript inside of StaterPlayer.StarterPlayerScripts