How would I create a raycast from the character that checks if a part is a parent of a specific value

Like the title says,I need help with creating a raycast from the player which follow the mouse and if the part its over is a parent of a value named “clickable” for example it prints “clickable”.

I might not understand your goal, but you would have to use FindFirstChild to determine if the part is a parent of another value

local raycastResult = workspace:Raycast(...) -- the arguments go here

if raycastResult then
    if raycastResult.Instance:FindFirstChild("clickable") then
        -- print clickable
    end
end

Use

Local clickParent = Raycastresult:FindFirstAncestor(“Clickable”)

I think he stated

the part its over is a parent of a value named “clickable”

In this case, “clickable” must be a child and not a parent