Alright, I wanted to print a player's name when I put my mouse on it's character, I tried to do the game.Players.LocalPlayer:GetMouse().Hit but it didn't work though. So I was wondering, if you could help me, thank you so much.
use Target
rather than Hit
because the former gives the object, and the latter gives the position. You can use game.Players.LocalPlayer:GetMouse().Target.Parent
and that should give you the character. Make sure to check it's a character though by doing :FindFirstChildWhichIsA("Humanoid")
and checking to see if that exists.
Already done. That's what I did:
local m = game.Players.LocalPlayer:GetMouse() local ErasureActive = game.ReplicatedStorage.ErasureActive.Value local ttime = "ok" m.KeyDown:connect(function(k) k = k:lower() if k == 'z' then if ttime == "ok" then local target = game.Players.LocalPlayer:GetMouse().Target local h = target.Parent:FindFirstChild('Humanoid') if h then print(h.Parent.Name) end end end end)