Hi guys, I need to get a parent of the part targeted by the mouse, I tried with something like this:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
function myFunction()
if tostring(mouse.Target) == "MyBrick" then
local instance = mouse.Target.Parent:FindFirstChild("InstanceID")
instance.Value = 15;
end
end
But that wont work, why?

3 comments
Let's see
Didn't work, I don't know why
Do you ever call that function? If you want that to happen when ever you click, you have to add this at end: mouse.Button1Down:connect(myFunction)