Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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.

0
Youd link the mouse.Move event to a function that checks if the mouse.Target is a character, then do your stuff. RubenKan 3615 — 7y
0
Okay, now I just got to figure out how to do that, xd. :D Kraken_54 22 — 7y
0
mouse = game.Players.LocalPlayer:GetMouse() RubenKan 3615 — 7y
0
Well I know that. But I mean getting the target and mouse.Move. :P Kraken_54 22 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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.

0
Okay thanks. Kraken_54 22 — 7y
Ad

Answer this question