Getting the player from Mouse.Target.Parent

I want to get the player from Mouse.Target.Player I think you could use :GetPlayerFromCharacter but im not sure how to use it.

2 Likes

If you are asking how to get the player of a character that the Mouse is hovering over, you could do this.

if Mouse.Target.Parent:FindFirstChild("Humanoid") then --check to make sure Mouse.Target is child of a character
    Character = Mouse.Target.Parent
    Player = game.Players:GetPlayerFromCharacter(Character) --this will return nil if a player isn't found based off of the character you passed
end
4 Likes