Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a player hover enter function in ROBLOX?

Well, you know how in a game like Prison Life for example, how if you hover over the player, it'll show their name? Well, I'm not doing that. But can someone help guide me on how I could make some hoverplayer function, or something...? I'm not asking anyone to do it for me, just a guide or a website tutorial would be much appreciated.

4 comments

0

Youd link the mouse.Move event to a function that checks if the mouse.Target is a character, then do your stuff.

0

Okay, now I just got to figure out how to do that, xd. :D

0

mouse = game.Players.LocalPlayer:GetMouse()

0

Well I know that. But I mean getting the target and mouse.Move. :P

1 answer

✓ Accepted answer

Best to do this in a local script (If you want to effect parts, you need to use Remotes)

Here is a local script I whipped up quickly:

local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()

Mouse.Move:connect(function() -- Everytime you move your mouse
	if Mouse.Target ~= nil and Mouse.Target.Parent:FindFirstChild("Humanoid") then
		local Char = Mouse.Target.Parent
		local isPlayer = game.Players:GetPlayerFromCharacter(Char) -- This is to make sure you're checking an actual player, not a possible NPC or something else with Humanoid
		if isPlayer then
			-- Now you place the code that can show their name or fire a Remote
		end
	end
end)

this is just a possible way, there are others but here is one.

1 comment

0

Okay thanks.

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