So I’m trying to improve my code skills and I need a little advice.
I’ve decided to try and make a script that when you hover over a player it would print their name in the output.
Need a little advice on how the script would work and trying to learn little by little.
Connect to the Mouse.Moved event and use the Mouse.Target property to check if the part the mouse is targeting is a descendant of a character (has a humanoid).
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
mouse.Moved:Connect(function()
local target = mouse.Target
if target and target.Parent:FindFirstChild("Humanoid") then
print(target.Parent.Name)
end
end)