trying to make a part detect if whatever's touching it has a value called "Break" then it will run "test". any solutions?
script.Parent.Touched:Connect(function(hit) if hit.Break then print("test") end end)
That errors because you aren’t checking for existence. Break doesn’t exist. If you want to check if it exists, use FindFirstChild. Try this script out:
script.Parent.Touched:Connect(function(hit) if hit:FindFirstChild("Break") then print("test") end end)