So, I have a problem. I have a cuffs system and a hover over player to display rank and username script, the problem is that when clicking or hovering over a players accessories, the scripts will not apply. When I hover over the base parts of their bodies, it works. I want it to work so that any part of the players body or accessories they have on, the scripts will apply. How would I do this?
You can use “Handle” part inside of Accessory instance.
Here are some options friend!
Option 1. You can ignore the accessories parts in whatever code you are using.
Option 2. You can get all parts in a Character Model using :GetDescendants() instead of :GetChildren()
Option 3. If your code detects the part its hovering above first, and then tries to get it’s parent there is a simple alternative.
Instead of checking if the Parent of the part is a character, you can use
:FindFirstAncestor("ItemName")
--This will search all parents of an object untill it finds the one you want.
For example:
function FindCharacterFromPart(Part)
local Found = nil
for i,Player in pairs(game.Players:GetPlayers()) do
if Part:FindFirstAncestor(Player.Name) then
Found = Part:FindFirstAncestor(Player.Name)
break
end
end
return Found
end
FindCharacterFromPart(YourPart)
This function would find a character from any part if there is one.