ok so I have a little bobblehead I want it so If the player right clicks on the bobble head it will check everything inside the bobblehead and see if there is an inspectable value and if there is then print (“Hello World!”) I have the right click and check code but I want to check all parts here is my code:
userInputService.InputBegan:Connect(function(input, gameProccessedEvent)
if input.UserInputType == inspectKey and not gameProccessedEvent then
for i, objects in pairs(mouse.Target:GetChildren()) do
if objects:IsA("BoolValue") and objects.Name == "Inspectable" and objects.Value == true then
print("HelloWorld")
end
end
end
end)
but what if I click a part inside of a model that has the value in a different part so like
--[[Model
--[[Part1
--[[Part2
--[[Value
so what if I click part 1 I want it to go to the mouse.Target.Parent and check not only the descendants of the model but all the descendants of models descendants
so if the value is placed anywhere inside the model it will find it
Nevermind I was just curios if this was a possible thing to do but I do have a more time costing way that will also solve other problems.
I could just add and invisible part onto the model and add the value into it so it’ll act like a hitbox this will also prevent players from climbing on the model.